Re: proc corruption 2.2.16pre1

From: Andrea Arcangeli (andrea@suse.de)
Date: Thu May 04 2000 - 18:54:08 EST


On Thu, 4 May 2000, H.J. Lu wrote:

>Please don't make such an assumption. I don't know what stdio
>will do on files under /proc. It may just call lseek.

I'm not sure I'm the only one who does such assumption. Certainly
/proc/memleak in the 2.3.x IKD does such assumption too and it's
stightforward that way (however that's from me and MikeG too so maybe I'm
really the only one who did this trick :).

My argument is that without doing such assumption is not possible to
support multiple reads in a /proc dynamic entry and being sure to read
coherent data. When we return to userspace everything can happen to the
hardware and when we return in kernel to read the next piece we can't
guess anymore what fpos means. So stdio will never be reliable without
such assumption. With such assumption don't do lseek or do it aware of the
assumption.

Could you tell me a good reason for which stdio should do a lseek while
reading stright a file? Just to screwup kernel readahead?

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:16 EST