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 linux-specific getdents code


Trond Myklebust <trond.myklebust@fys.uio.no> writes:

> it was found that the bug lies partly in Linux kernels 2.4.x, and
> partly in the assumptions of the glibc-2.2.

I don't agree with most parts of your analysis.

>   - The first problem is generic: Glibc uses __lseek rather than
>     __lseek64 for the output offsets from getdents.

OK, I can buy that.

But the lseek calls have to stay.

>   - The second problem is more NFS-specific: Glibc is unable to cope
>     with NFS allowing unsigned offsets, and returns an EOVERFLOW error
>     as if the cookie were a large file offset if the 31st bit is set
>     (and the getdents64() function is used).

Offsets by definition are unsigned.  You are changing the interface of
the kernel.  This is absolutely unacceptable.

>   - Finally, there is the assumption that the value '-1', as used by
>     last_offset, cannot occur as a valid cookie. This is again related
>     to point 2, but it occurs both for getdents64()-enabled kernels
>     and older.

You are changing again the kernel interface.  You cannot do this.
Stay within the defined interface.  Even if some of this would be
changed this does not change the fact that older versions are not
working this way.

All the problems are entirely the kernels fault.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


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