Bug 845565

Summary: Disconnected NFS directories cause hang on
Product: [Fedora] Fedora Reporter: Andrey <sorcchan>
Component: kernelAssignee: nfs-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dennis, gansalmon, itamar, jlayton, jonathan, kernel-maint, madhu.chinakonda
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-20 19:31:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrey 2012-08-03 13:04:24 UTC
Description of problem: I have few mounted directories via NFS. If remote computers disconnected it cause hang on all file system requests to this mounted direcotories and direcories where links to this mounted dirs placed.


How reproducible: every time mounted directory disconnected


Steps to Reproduce:
1. mount some NFS directory
2. unplug network cable from remote PC
3. try to umount mounted dir or ls directory where link to mounted dir placed
  
Actual results:
umonut and ls is hang on


Expected results:
umonunt do nothig/force unmount/return error - anything but not hang on


Additional info:
I've try to use handmade program to umount disconnected directories as some guy recommend in comment at related bugreport here https://bugzilla.redhat.com/show_bug.cgi?id=820707#c2

#include <sys/mount.h>
int main(int argc, char **argv) {
    umount2(argv[1], MNT_FORCE);
    return 0;
}

but umount2() call hang on too.

Comment 1 Jeff Layton 2012-08-20 17:28:27 UTC
(In reply to comment #0)
> Description of problem: I have few mounted directories via NFS. If remote
> computers disconnected it cause hang on all file system requests to this
> mounted direcotories and direcories where links to this mounted dirs placed.
> 
> 
> How reproducible: every time mounted directory disconnected
> 
> 

Can you clarify what you mean by "disconnected"? Do you mean that the server has gone completely unreachable?

Comment 2 Jeff Layton 2012-08-20 19:31:50 UTC
> 
> Steps to Reproduce:
> 1. mount some NFS directory
> 2. unplug network cable from remote PC
> 3. try to umount mounted dir or ls directory where link to mounted dir placed
>   
> Actual results:
> umonut and ls is hang on
> 
>


Ahh, I'm afraid that's expected behavior. When there is an interruption in network connectivity, the client will retry calls to the server indefnitely by default. Anything else can lead to corrupt data. 

You have some options however...

1) you can mount with -o soft, which will cause the client to time out RPCs after a certain amount of time with no response

2) you can attempt to lazily unmount the mount (umount -l). That will disconnect it from the network namespace but will keep it around until there are no more references to it.