linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nfs cache bug (when server delete the file ,nfs client can read file also)
@ 2012-11-23  4:18 fanchaoting
  2012-11-23  5:11 ` Myklebust, Trond
  0 siblings, 1 reply; 8+ messages in thread
From: fanchaoting @ 2012-11-23  4:18 UTC (permalink / raw)
  To: Myklebust, Trond, bfields; +Cc: linux-nfs@vger.kernel.org

Hi,everyone. I found a big bug abount nfs cache.

when server delete the file ,nfs client can read file also.

the following is the reproduce.

ip: 192.168.0.19  nfs-client
ip: 192.168.0.20  nfs-client
ip: 192.168.0.21  nfs-server

############################################################################

/usr/bin/ssh -n 192.168.0.21 service nfs start
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.19 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.20 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.21 "rm -rf /nfsroot; mkdir -p /nfsroot"
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/exportfs -au
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/exportfs -i -o insecure,no_root_squash,rw,fsid=0 *:/nfsroot
/usr/bin/ssh -n 192.168.0.19 test -d /nfsroot || (rm -rf /nfsroot; mkdir -p /nfsroot)
/usr/bin/ssh -n 192.168.0.20 test -d /nfsroot || (rm -rf /nfsroot; mkdir -p /nfsroot)

/usr/bin/ssh -n 192.168.0.19 umount /nfsroot
/usr/bin/ssh -n 192.168.0.20 umount /nfsroot
cmd="echo \"hello world\" > /nfsroot/tmpfile"
/usr/bin/ssh -n 192.168.0.21 $cmd
/usr/bin/ssh -n 192.168.0.21 mkdir /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.21 touch /nfsroot/tmpdir/tmpdfile
/usr/bin/ssh -n 192.168.0.19 mount -t nfs4 192.168.0.21:/ /nfsroot
/usr/bin/ssh -n 192.168.0.20 mount -t nfs4 192.168.0.21:/ /nfsroot
/usr/bin/ssh -n 192.168.0.21 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.21 ls -l /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.19 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.19 ls -l  /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.20 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.20 ls -l  /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.19 cat /nfsroot/tmpfile > /dev/null
/usr/bin/ssh -n 192.168.0.20 cat /nfsroot/tmpfile > /dev/null
/usr/bin/ssh -n 192.168.0.21 rm -rf /nfsroot/tmpfile
echo -e "sleep 60~~~~~~~~\n"
sleep 60

#############################################################################

last: In 192.168.0.19 I do:

#cat /nfsroot/tmpfile           <--the nfs server delete the file,but nfs client can read the file
 hello world


I think  when the nfs server delete the file ,
the  server should notice the nfs client,
but the upstream kernel does't this.
 




^ permalink raw reply	[flat|nested] 8+ messages in thread
* nfs cache bug (when server delete the file ,nfs client can read file also)
@ 2012-11-23  4:32 fanchaoting
  0 siblings, 0 replies; 8+ messages in thread
From: fanchaoting @ 2012-11-23  4:32 UTC (permalink / raw)
  To: Myklebust, Trond, bfields
  Cc: linux-nfs@vger.kernel.org, 范朝挺

Hi,everyone. I found a big bug abount nfs cache.

when server delete the file ,nfs client can read file also.

the following is the reproduce.

ip: 192.168.0.19  nfs-client
ip: 192.168.0.20  nfs-client
ip: 192.168.0.21  nfs-server

############################################################################

/usr/bin/ssh -n 192.168.0.21 service nfs start
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.19 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.20 /usr/sbin/rpc.idmapd
/usr/bin/ssh -n 192.168.0.21 "rm -rf /nfsroot; mkdir -p /nfsroot"
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/exportfs -au
/usr/bin/ssh -n 192.168.0.21 /usr/sbin/exportfs -i -o insecure,no_root_squash,rw,fsid=0 *:/nfsroot
/usr/bin/ssh -n 192.168.0.19 test -d /nfsroot || (rm -rf /nfsroot; mkdir -p /nfsroot)
/usr/bin/ssh -n 192.168.0.20 test -d /nfsroot || (rm -rf /nfsroot; mkdir -p /nfsroot)

/usr/bin/ssh -n 192.168.0.19 umount /nfsroot
/usr/bin/ssh -n 192.168.0.20 umount /nfsroot
cmd="echo \"hello world\" > /nfsroot/tmpfile"
/usr/bin/ssh -n 192.168.0.21 $cmd
/usr/bin/ssh -n 192.168.0.21 mkdir /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.21 touch /nfsroot/tmpdir/tmpdfile
/usr/bin/ssh -n 192.168.0.19 mount -t nfs4 192.168.0.21:/ /nfsroot
/usr/bin/ssh -n 192.168.0.20 mount -t nfs4 192.168.0.21:/ /nfsroot
/usr/bin/ssh -n 192.168.0.21 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.21 ls -l /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.19 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.19 ls -l  /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.20 cat  /nfsroot/tmpfile
/usr/bin/ssh -n 192.168.0.20 ls -l  /nfsroot/tmpdir
/usr/bin/ssh -n 192.168.0.19 cat /nfsroot/tmpfile > /dev/null
/usr/bin/ssh -n 192.168.0.20 cat /nfsroot/tmpfile > /dev/null
/usr/bin/ssh -n 192.168.0.21 rm -rf /nfsroot/tmpfile
echo -e "sleep 60~~~~~~~~\n"
sleep 60

#############################################################################

last: In 192.168.0.19 I do:

#cat /nfsroot/tmpfile           <--the nfs server delete the file,but nfs client can read the file
 hello world


I think  when the nfs server delete the file ,
the  server should notice the nfs client,
but the upstream kernel does't this.
 





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

end of thread, other threads:[~2012-11-26  5:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23  4:18 nfs cache bug (when server delete the file ,nfs client can read file also) fanchaoting
2012-11-23  5:11 ` Myklebust, Trond
2012-11-23  5:23   ` fanchaoting
2012-11-23  5:36     ` Myklebust, Trond
2012-11-23  6:00       ` fanchaoting
2012-11-23 17:20         ` bfields
2012-11-26  5:41           ` fanchaoting
  -- strict thread matches above, loose matches on Subject: below --
2012-11-23  4:32 fanchaoting

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).