linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NFSv3 caching vs NFSv4
@ 2012-09-05 12:40 Diego Moreno
  2012-09-05 14:49 ` Myklebust, Trond
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Moreno @ 2012-09-05 12:40 UTC (permalink / raw)
  To: linux-nfs

Hello everyone,

Performing some attribute caching tests I think I found some 
inconsistencies between nfsv3 and nfsv4. Running a kernel based on 
rhel6.3 (2.6.32-279.el6.x86_64) I found nfsv4 doesn't manage a file 
modified on the server side (even with the noac mount option) while 
nfsv3 does.

My test will be modifying a file every second on the server mount point:

[root@nfs ~]#  FILE=/tmp/nfs_server/myfile ;  while true ; do sleep 1 ; 
sed -i 's/text1/text2/g' $FILE ; cat $FILE ; sleep 1; sed -i 
's/text2/text1/g' $FILE ; cat $FILE ; done
text2
text1
text2
text1
text2
(and so on...)

Meanwhile, the client (which BTW is the same machine) will read the file 
every second :

With NFSv4:

[root@nfs ~]# mount -o noac,vers=4 nfs:/tmp/nfs_server/ /tmp/nfs_client/
[root@nfs ~]# for i in 1 2 3 4 5 ; do cat /tmp/nfs_client/myfile; sleep 
1 ; done
text2
text1
text1
text1
text1

With NFSv3:
[root@nfs ~]# mount -o noac,vers=3 nfs:/tmp/nfs_server/ /tmp/nfs_client/
[root@nfs ~]# for i in 1 2 3 4 5 ; do cat /tmp/nfs_client/myfile; sleep 
1 ; done
text1
text2
text1
text2
text1

I can see in the tcpdump traces how the new change attribute and the 
FATTR4_TIME_MODIFY attributes are well received but it's as if the nfs 
client were ignoring these changes. I've been searching in the NFS list 
but I didn't find anything similar. Is this a bug or just a normal 
behavior? Sorry if it has been already pointed out.

Regards,

Diego Moreno

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-06  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 12:40 NFSv3 caching vs NFSv4 Diego Moreno
2012-09-05 14:49 ` Myklebust, Trond
2012-09-05 17:21   ` J. Bruce Fields
2012-09-06  8:17     ` Diego Moreno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).