OK. I overlooked the "atomically". You would have to snapshot the data
and then dole it out to subsequent reads, and then ...
> this I mean a consistent view of the data, even if it changes while
> you are reading it. The reason is that you cannot hold a lock between
> calls to the ->read_proc method. You also cannot distinguish between
> calls made by different readers (you don't get an unique "struct file"
> for each reader like you do with devices).
I agree. This is the defect of the current code. You cannot really be
sure if you are seeing a repeat call for more data from the same
process, or you are seeing someone else starting to try and sneak
data from the file. You can be pretty sure if the offsets match up,
but not certain.
This is a general defect .. I would like to see block transactions
identified according to who asked for them, and a sequence number.
Then I could journal file level transactions reliably ...
> Of course this is not an issue for /proc/config since the data is
> static.
Not always.
Peter
-
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/