bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: Possible problem with savedir.c (XFS over NFS)


From: Paul Eggert
Subject: Re: [bug-gnulib] Re: Possible problem with savedir.c (XFS over NFS)
Date: Sun, 05 Dec 2004 21:33:48 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

James Youngman <address@hidden> writes:

> Someone has just pointed out to me that this may well be a Linux kernel bug:-

It could be, yes, but it's still a bug in savedir -- and more generically,
it's a problem in all the gnulib and coreutils code that uses readdir.

Suppose we are using an NFS filesystem where the remote inode numbers
are wider than the local ones.  Then (with the XSI extension) POSIX
says that readdir is supposed to set the d_ino field of struct dirent,
but since this overflows readdir is supposed to fail with
errno==EOVERFLOW instead.

savedir currently returns NULL in this situation, which means apps don't
recurse a directory if any of its entries have too-wide inode numbers.
Typically, though, apps will want to skip the troublesome entries
and process the non-troublesome ones.

I suppose we could modify savedir's API so that it returns an error
indication even when it doesn't fail, which would mean "some of the
directory entries were bogus, but here are the entries I found".

There are similar problems with the rest of gnulib, coreutils, etc.
but we can use savedir as a guinea pig for this.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]