On Thu, Jul 2, 2009 at 8:07 AM, Peter Tribble<peter.trib...@gmail.com> wrote:
> We've just stumbled across an interesting problem in one of our
> applications that fails when run on a ZFS filesystem.
>
> I don't have the code, so I can't fix it at source, but it's relying
> on the fact that if you do readdir() on a directory, the files come
> back in the order they were added to the directory. This appears
> to be true (within certain limitations) on UFS, but certainly isn't
> true on ZFS.
>
> Is there any way to force readdir() to return files in a specific order?
> (On UFS, we have a scipt that creates symlinks in the correct order.
> Ugly, but seems to have worked for many years.)
>
> If not, I was looking at interposing my own readdir() (that's assuming
> the application is using readdir()) that actually returns the entries in
> the desired order. However, I'm having a bit of trouble hacking this
> together (the current source doesn't compile in isolation on my S10
> machine).

Is one of these your starting point?  What errors are you seeing?

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/readdir.c
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/readdir.c

The libbc version hasn't changed since the code became public.  You
can get to an older libc variant of it by clicking on the history link
or using the appropriate hg command to get a specific changeset.


-- 
Mike Gerdts
http://mgerdts.blogspot.com/
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to