Re: [PATCH][RFC] Re: 2.4.15-pre5: /proc/cpuinfo broken

Alexander Viro (viro@math.psu.edu)
Sat, 17 Nov 2001 14:03:01 -0500 (EST)


On Sat, 17 Nov 2001, Linus Torvalds wrote:

>
> On Sat, 17 Nov 2001, Alexander Viro wrote:
> >
> > Frankly, I'd prefer to try (b) before reverting to (a). Patch doing that
> > variant follows. Linus, your opinion?
>
> (d) make seq_file have my originally suggested "subposition" code.
>
> Ie make the X low bits of "pos" be the position in the record, with the
> high bits of "pos" being the current "record index" kind of thing.
>
> That makes lseek() happy.

It will not help. lseek() in question is relative and crosses the
record boundary. I.e. we have

n = read(fd, buf, ...);
/* process k bytes */
lseek(fd, k-n, SEEK_CUR);

and that will break just as the current variant does. It's not about
seek to remembered position - it's a relative seek to calculated offset.
Calculated from number of bytes returned by read().

-
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/