Re: Is "unmount -f" worked as expected?

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

 



Hi: All:

 Thanks Joshua for great help.   From context provided by joshua, I am believe that the community is full aware of the “-f “ issue, but still pending on solution. 

 Wondering whether community have consensus yet on what should be the correct behavior for “ force unmount”?  I hope maintainer of NFS can give some guardian for direction.

My use case is also on embedded system where NFS server can go offline unexpected. What I looks for is something that can aggressive umount NFS in timely manner.  Data loss is secondly in my situation.  One case  is involved with  cross mounted nfs from different host. Here, both server and client will be  shutdown at same time on reboot.  NFS client side will stuck on shutdown for long time if “umount –l”  is used to umount NFS.

The previous work done by Joshua and  Neil Brown will definitely help to resolve my use case if patch can be up streamed.  Hope magic will happen soon . 

Just wondering whether a kernel configure (eg.  CONFIG_NFS_AGRRESSIVE_SHUTDOWN)  can be added to enhance “force  umount “ to act more aggressive.
This feature will be off by default so the admin use to the “soft “ force mount will get the same behavior as before.  When the feature is turn on,  “umount –f”  is 
Guarantee to succeed.  


>On 5/30/18, 6:44 AM, "Joshua Watt" <jpewhacker@xxxxxxxxx> wrote:

 >   On Wed, 2018-05-30 at 00:38 +0000, Shawn Lu (shawlu) wrote:
 >   > 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 ?   
    
 >   I'm not an NFS maintainer, but I had a very similar question a few
 >   months ago and even wrote some patches to try and get a more "forceful"
 >   unmount. Unfortunately, I got distracted with other tasks and haven't
 >   looped around to finish the job. You can read through the lengthy
 >   discussion and patches here:
    
 >   Initial Discussion:
 >   https://www.spinics.net/lists/linux-nfs/msg66073.html
    
 >   RFC Patches:
 >   https://www.spinics.net/lists/linux-nfs/msg66348.html
 >   https://www.spinics.net/lists/linux-nfs/msg66421.html
 >   https://www.spinics.net/lists/linux-nfs/msg66466.html
 >   https://www.spinics.net/lists/linux-nfs/msg66483.html
    
 >   Hopefully, that helps. If you are interested in reviving this work, I
 >   am still interested and would be willing to help out.

Yes.  The patch provided will help.  I will try it out and ask for  help if I need go further.
 >   > 
 >    > Really appreciate if someone in the mailing list can help to answer
 >    > my dumb questions. 
 >    > 
 >    > 
 >    > Thanks,
 >    > Shawn 
 > 
 > 
 > 
 > 
 > 
 > 
  > NrybXǧv^)޺{.n+{"^nrz?h&?Gh?(階ݢj"??mzޖfh~m
    
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