Re: NFS Client patch

Rob Landley (landley@webofficenow.com)
Sun, 22 Jul 2001 11:15:07 -0400


On Thursday 19 July 2001 14:24, Pavel Machek wrote:
> Hi!
>
> > > In any case, what happens if the file was renamed or removed between
> > > the 2 readdir calls. A cookie identifying a name that was returned
> > > last, or should be read next is just as volatile as a cookie that
> > > contains an offset into the directory.
> >
> > No, if the file was removed, it still tells you where to start your
> > search. A missing filename is just as good a marker as a present one.
>
> And if new file is created with same name?
> Pavel

The same thing that happens as if a new file was inserted BEFORE your cursor,
in the part of the directory you've already looked at. You ignore it.

The "filename cookie" indicates the LAST file we looked at. We've already
seen it. Therefore, whether it's the same file or not, we don't care. We
just want the next file AFTER that one.

We're doing fairly arbitrary, unlocked reads across volatile data. No
algorithm is going to behave perfectly here. We just want a behavior that is
consistent, guaranteed to complete, and doesn't violate any obvious
constraints about how filesystems should behave (like producing duplicate
entries, which returning two different sets of data with the same filename
would do).

Makes sense to me, anyway...

Rob
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/