Bug 798251

Summary: Running 'exportfs' for exports to netgroups on running server causes NFS3 clients to hang
Product: [Fedora] Fedora Reporter: Stefan Walter <walteste>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: baumanmo, bfields, jlayton, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-08 11:07:18 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Stefan Walter 2012-02-28 07:36:36 EST
Description of problem:

When NFS exports to netgroups are added via 'exportfs' on an already running
NFS server this may cause clients that already have mounted NFS3 shares to
hang.

Version-Release number of selected component (if applicable):

kernel-PAE-3.3.0-0.rc4.git1.4.fc17.i686
nfs-utils-1.2.5-12.fc17.i686

Actually the bug persists through F13 to F17 and EL 6.0 to 6.2 (these are
the versions I tried). As NFS clients I have tried EL5, EL6 and F16 but I
believe any NFS3 client will hang.

How reproducible:

Always with the reproducer below on F13 to F17 or EL6 with any update level.

Steps to Reproduce:

1. Setup host 'server' as NFS server. Permanently disable the firewall
   and SELinux. Enable nfsd debug output ('sysctl -w sunrpc.nfsd_debug=32767').

2. On 'server' add the following export to /etc/exports

   /export/test1 *(rw,async,no_root_squash,no_subtree_check,fsid=99999)

3. On 'server' change /etc/nsswitch.conf to look up netgroups in files and
   populate /etc/negroups by running

   for i in `seq 1 1000`;do echo "x$i (host.example.com,,)";done >/etc/netgroup

4. Create the directories /export/test1 and /export/test2 on 'server', then
   restart the nfs-server service, reboot or run 'exportfs -r'.

5. Setup host 'client' as NFS3 client. Permanently disable the firewall
   and SELinux.

6. On 'client' mount the exported directory to '/mnt' with NFS3:

   mount -o rw,nfsvers=3 server:/export/test1 /mnt

7. On 'client' run the following line as root and observe the output:

   cd /mnt ; while (true); do date;ls >/dev/null;touch x;sleep 1; done
  
8. On 'server' run the following line as root:

   for i in `seq 1 1000`; do mkdir -p /export/test2/$i ; exportfs -o \
   rw,async,no_root_squash,no_subtree_check,fsid=99999$i \
   @x$i:/export/test2/$i ; done

Actual results:

A few seconds after executing step 8 the output on 'client' will stop. Accesses
to /mnt will hang on 'client'. On 'server' the following lines will appear
in the output of 'dmesg':

   [...] nfsd: Dropping request; may be revisited later

When restarting the nfs-server service or running 'exportfs -r' the client
recovers almost immediately.

Expected results:

Access to the mounted NFS3 share should not hang.

Additional info:

I filed BZ797209 for the same bug in EL 6.2 two days ago. This bug is critical
for a deployed NFS server cluster at our site. Since it is also present in
bleeding-edge F17 I hope this bug gets more attention and therefore is resolved
more quickly.
Comment 1 Stefan Walter 2012-03-01 04:48:33 EST
I found the bug. An analysis and two suggestions to fix it can be found in
BZ797209.
Comment 2 Steve Dickson 2012-11-08 11:07:18 EST

*** This bug has been marked as a duplicate of bug 797209 ***