Re: size of files in /proc

David Woodhouse (Dave@imladris.demon.co.uk)
Mon, 25 May 1998 11:06:29 +0200


kevinl@cs.monash.edu.au said:
> So why do you accept different behaviour in the two situations. Why
> not argue that NFS should accept the answer from stat or try the read,
> not do different things depending on the result?

NFS must return a version of the file that was valid. It doesn't matter when
it was valid, as long as it is an accurate representation.

So if a file is empty, then NFS will tell the client that it's empty, and
we'll all be happy. The time of the snapshot is the time of the stat() call.

Likewise, if a file is 100 bytes long at the time of the stat(), and then
immediately gets overwritten by 200 bytes of different data, then it doesn't
matter which one NFS returns to the client. It can either retrieve the
original data and length, or the new data and length. But to return the first
100 bytes of the new data would not be appropriate.

That said, I don't see why NFS doesn't just try the read in the first place,
instead of the stat() call. Perhaps it has to stat anyway, in order to get the
permissions of the file?

---- ---- ----
David Woodhouse, Robinson College, CB3 9AN, England. (+44) 0976 658355
Dave@imladris.demon.co.uk http://www.imladris.demon.co.uk
finger pgp@dwmw2.robinson.cam.ac.uk for PGP key.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu