[Labeled-nfs] Need some help on the internal working of NFS
Peter Staubach
staubach at redhat.com
Wed Nov 28 08:41:03 EST 2007
Ramakrishna wrote:
>
> Hi all,
>
> Iam working on a small project related to NFS. In my application i
> need to watch out what is being read or written by the client.I
> studied the NFS documentation. The client can write data to the file
> only using the write procedure of the NFS program. Similarly, it can
> read only through the read procedure. I tried to do based on this
> assumption. Whatever client writes goes to the server in awrite
> command. It was fine. But, when client reads data not always read
> procedure is used to read the data from the server.
>
> I mounted a directory of the server on my client. After that I could
> track what all iam writing( data written into a file, not anyother
> information) to the directory by simply tracking the write
> procedure calls. I used ethereal to capture the packets and
> analyse.But when it reads not always read procedure is used. When i
> open a file(small file) and analyse the packets through
> ethereal, sometimes read procedure is not at all called but the
> file is opened and the data is shown.
>
> How the client gets the data without calling the read procedure?
> Help me out.
This isn't the appropriate mailing list for this question, but the
short answer is caching. Most NFS clients cache data which is
written or read once in the page cache and as long as the data stays
in the page cache, it can be retrieved from there without having to
go over the network to the server.
Thanx...
ps
More information about the Labeled-nfs
mailing list