Is "unmount -f" worked as expected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Maintainers of NFS:

  I need help to better understand behavior of “-f” option for  “umount” NFS file system.  Here is what I got from   Man page (  https://linux.die.net/man/8/umount) :

 “ -f Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)” 

My interpretation of Man page is “umount –f”  should able to force umount nfs when NFS server is not available. 

On my test, I am observed “umount –f”  is not always work as expected.  Also there some behavior difference on  “umount –f “ with regarding to different NFS version.  
Here is my experiment on 4.4 Kernel ( I am believe this is true for latest kernel):
  Test for nfsv3:
a)  From Host A, Start NFS server and export “/shared” directory ,which has only my file test.txt
b)  from Host B,   remote mount  host A:/shared to    /test  using nfsv3
c)  from host B  open file /test/test.txt
d) from host B,  do  “umount –f  /test“,  it returns “device is busy”
e) From host A ,  do following “rm  -f /etc/exports ; touch /etc/exports ; exportfs -ra”
f) From host B ,    do  “umount –f  /test“,  it returns “device is busy”
g) Reboot HOST A
h) From host B:  do  “umount –f  /test“  succeed. 

 Test for nfsv4:
i)	 From Host A, Start NFS server and export “/shared” directory ,which has only my file test.txt
j)	 from Host B,   remote mount  host A:/shared to    /test  using nfsv4
k)	 from host B  open file /test/test.txt
l)	from host B,  do  “umount –f  /test“,  it returns “device is busy”
m)	From host A ,  do following “rm  -f /etc/exports ; touch /etc/exports ; exportfs -ra”
n)	From host B ,    do  “umount –f  /test“,  it returns “device is busy”
o)	Reboot NFS server( HOST A)
p)	From host B:  do  “umount –f  /test“  ,  still return “device is busy”
   

For both nfsv3 and nfsv4,  “umount –f “ will fails even the super block is already “staled”(check step f and step n) .  “-f” option for NFSv4 is more “broken” since now it will not succeed even with NFS server off line.  

Here my questions:
1. If “umount –f “  can’t force unmount “staled ” nfs mount ,   How it differential itself from regular umount (without –f)?  
2. is  “-f”  option is “broken” for NFSv4 or it is intend behavior to fail “umount –f” even Server is offline ?   

Really appreciate if someone in the mailing list can help to answer my dumb questions. 


Thanks,
Shawn 






��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux