This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] for glibc-2.2 getdents code


On Wed, Feb 21, 2001 at 08:46:42AM -0800, H . J . Lu wrote:
> On Wed, Feb 21, 2001 at 09:05:28AM +0100, Jakub Jelinek wrote:
> > On Tue, Feb 20, 2001 at 04:37:02PM -0800, H . J . Lu wrote:
> > > Thanks for your testcase. But I believe your proposed patch is
> > > incorrect. It won't work with telldir/seekdir. I think the glibc
> > > bug is to use the getdents64 system call to implement getdents ()
> > > on a 32bit system. It doesn't make any senses since getdents () is
> > > a 32bit interface on a 32bit system.  Here is a patch.
> > 
> > It makes a lot of sense. Only getdents64 system call sets the d_type field.
> 
> If you want to get d_type, use getdents64, but not getdents. It is
> the same as LFS. You can only get the right information with the
> right interface.

But d_type should be completely orthogonal to LFS. It is not present in
sys_getdents simply because sys_getdents was there before d_type was
introduced and as userland getdents can call sys_getdents64 to get d_type,
I have not added sys_newgetdents.
IMHO the fix is really simple, if kernel nfs client will cast the offset for
NFSv2 properly (it goes as 32bit value over the network AFAIC), then the
problem will go away. And if people are using NFSv3 and the server passes
d_off's which don't fit into 32bit off_t, then IMNSHO kernel sys_getdents
should fail on it the same way as glibc getdents does, because it is better
to give user error than incorrect information (= silently discarded bits
from d_off).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]