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: getdents64 problem


>>>>> " " == Jakub Jelinek <jakub@redhat.com> writes:

     > You're passing that unmodified u64 value to filldir which is
     > off_t (ie.  signed 32 or 64bit), so IMHO you basically have 2
     > options, either sign-extend it at cookie assignment time, or
     > find out if cookie comes from NFSv2 protocol (inherently 32bit)
     > and sign-extend cookies before passing them to filldir (in both
     > cases do nothing about NFSv3 cookies).

No. The correct thing is to not pass cookies outside the NFS
layer. I'm therefore thinking along the lines of creating a dictionary
in the inode to allow us to assign 32-bit signed numbers to cookies,
and hence to use those for filldir/lseek/...
This has to be done with care, since we cannot assume that the order
of entries/cookies will be preserved across cache rereads.

I therefore have 1 question: does glibc make any assumptions about the
filldir offsets (other than that they are signed and positive)? Do you
for example expect monotonicity (i.e. that the next entry has an
offset with a value guaranteed to be larger that of the current
entry)?

Cheers,
  Trond

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