Bug 458622

Summary: improper behavior of rpc.mountd on NFS server leads to BUG on NFS client
Product: [Fedora] Fedora Reporter: Vasily Averin <vvs>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-09 07:52:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasily Averin 2008-08-11 06:40:52 UTC
Description of problem:
Specific NFS server setup results on BUG on linux nfs client:
nfs_follow_mountpoint
  BUG_ON(IS_ROOT(dentry))

the configuration is the following:
tc27.qa.sw.ru -- NFS server (FC8)
ts27.qa.sw.ru -- NFS client (RHEL5)

Server configuration is the following:
[root@tc27 proc]# cat /etc/exports 
/nfs_share ts27.qa.sw.ru(rw,no_root_squash,no_subtree_check,crossmnt)
/nfs_share/boo *(rw,no_root_squash,no_subtree_check)
[root@tc27 proc]# cat /proc/mounts 
/dev/mapper/vzvg-vz /nfs_share ext3 rw,data=ordered 0 0
/dev/sda1 /nfs_share/boo ext3 rw,data=ordered 0 0

Issue can be reproduced by the following script on CLIENT SIDE:

[root@ts27 ~]# cat sub-mounts.sh 
#!/bin/bash

echo 65535 > /proc/sys/sunrpc/nfs_debug
echo 65535 > /proc/sys/sunrpc/rpc_debug

stat -f /mnt/nfs/ | grep -q 'Type: nfs' ||
mount -v -t nfs tc27:/nfs_share /mnt/nfs -o vers=3,tcp,hard,nointr
{
ls /mnt/nfs
ls /mnt/nfs/boo
} >/dev/null

echo ===========================
grep nfs /proc/mounts
umount /mnt/nfs/

This BUG_ON  happens due to improper behavior of rpc.mountd process on the nfs server. This is proven by the following file on the server:

[root@tc27 proc]# cat /proc/net/rpc/nfsd.fh/content
#domain fsidtype fsid [path]
*,ts27 0 0x0000fd0000000002 /nfs_share
*,ts27 0 0x0100080000000002 /nfs_share

As you can see it contains /nfs_share instead of /nfs_share/boo for 0x0100080000000002 fsid.

Version-Release number of selected component (if applicable):
nfs-utils-1.1.0-6.fc8

Actual results:
BUG_ON on client side on nfs submount lookup because of incorrect content of 
/proc/net/rpc/nfsd.fh/content file

Expected results:
correct content of /proc/net/rpc/nfsd.fh/content file

Comment 1 Steve Dickson 2008-08-11 13:46:07 UTC
The patch posted to the linux-nfs mailing list:

Unfortunately, BUG_ON(IS_ROOT(dentry)) can happen inside
nfs_follow_mountpoint with NFS running Fedora 8 using a
specific setup.
https://bugzilla.redhat.com/show_bug.cgi?id=458622

So, the situation should be handled on NFS client gracefully.

Signed-off-by: Denis V. Lunev <den>
CC: Trond Myklebust <Trond.Myklebust>
CC: J. Bruce Fields <bfields>
---
 fs/nfs/namespace.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index 66df08d..4f11c13 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -105,7 +105,10 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
 
 	dprintk("--> nfs_follow_mountpoint()\n");
 
-	BUG_ON(IS_ROOT(dentry));
+	err = -ESTALE;
+	if (IS_ROOT(dentry))
+		goto out_err;
+
 	dprintk("%s: enter\n", __func__);
 	dput(nd->path.dentry);
 	nd->path.dentry = dget(dentry);

Comment 2 Vasily Averin 2008-08-12 08:10:28 UTC
I've created a separate bug for RHEL5 NFS client panic
https://bugzilla.redhat.com/show_bug.cgi?id=458774

Comment 3 Bug Zapper 2008-11-26 11:05:19 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Bug Zapper 2009-01-09 07:52:11 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.