On Sat, Jun 09, 2007 at 02:01:35PM -0700, Eric Schrock wrote:
> On Sat, Jun 09, 2007 at 01:56:35PM -0700, Ed Ravin wrote:
> > 
> > I encountered the problem in NetBSD's scandir(), when reading off
> > a Solaris NFS fileserver with ZFS filesystems.  I've already filed a
> > bug report with NetBSD.  They were using the st_size, divided by 24, to
> > determine how much memory to allocate with malloc() before reading in
> > the directory entries.  All without any sanity checking.
...
> Yikes.  Even on a 'normal' filesystem, what happens if entries are added
> to a directory in the middle of such an operation?

Actually, there is some sanity checking in the NetBSD scandir() after
the first block is allocated, but because of their base assumption
that st_size is always (number_of_dir_entries * 24) it never allocates
enough memory when talking to a ZFS filesystem.

        -- Ed
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to