rpms/kernel/devel linux-2.6-nfs-client-mounts-hang.patch, NONE, 1.1 kernel.spec, 1.606, 1.607

Dave Jones (davej) fedora-extras-commits at redhat.com
Sat Apr 12 16:47:26 UTC 2008


Author: davej

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25906

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-nfs-client-mounts-hang.patch 
Log Message:
Fix NFS Client mounts hang when exported directory do not exist

linux-2.6-nfs-client-mounts-hang.patch:

--- NEW FILE linux-2.6-nfs-client-mounts-hang.patch ---
>From davej  Fri Apr 11 11:23:51 2008
Return-Path: <SteveD at redhat.com>
X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
	quoit.install.boston.redhat.com
X-Spam-Level: 
X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,
	UNPARSEABLE_RELAY autolearn=ham version=3.2.4
Received: from pobox.devel.redhat.com [10.11.255.8]
	by quoit.install.boston.redhat.com with IMAP (fetchmail-6.3.8)
	for <davej at localhost> (single-drop); Fri, 11 Apr 2008 11:23:51 -0400 (EDT)
Received: from pobox.devel.redhat.com ([unix socket])
	 by pobox.devel.redhat.com (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with LMTPA;
	 Fri, 11 Apr 2008 11:23:04 -0400
X-Sieve: CMU Sieve 2.2
Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
	by pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id m3BFN4Vn004738
	for <davej at pobox.devel.redhat.com>; Fri, 11 Apr 2008 11:23:04 -0400
Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147])
	by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3BFN3oE027502;
	Fri, 11 Apr 2008 11:23:03 -0400
Received: from [10.13.248.55] (vpn-248-55.boston.redhat.com [10.13.248.55])
	by file.rdu.redhat.com (8.13.1/8.13.1) with ESMTP id m3BFN16w019076;
	Fri, 11 Apr 2008 11:23:02 -0400
Message-ID: <47FF824B.9060508 at RedHat.com>
Date: Fri, 11 Apr 2008 11:22:51 -0400
From: Steve Dickson <SteveD at redhat.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To: Jesse Keating <jkeating at redhat.com>
CC: Dave Jone <davej at redhat.com>
Subject: [Fwd: [PATCH] NFS Client mounts hang when exported directory do not
 exist]
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254
Status: RO
Content-Length: 3085
Lines: 101

Jesse, here is the patch thats needed to stop NFS installs 
from hanging... Unfortunately is not as simple as I 
thought it would be since I have t patch the kernel. 

Dave, this regression could cause some major pain,
so you might want to consider taking this patch 
sooner verses later... As you can see, I've already purposed 
the patch to upstream and will let know how that works out.

steved.

-------- Original Message --------
Subject: [PATCH] NFS Client mounts hang when exported directory do not exist
Date: Fri, 11 Apr 2008 11:12:12 -0400
From: Steve Dickson <SteveD at redhat.com>
To: Linux NFS Mailing list <linux-nfs at vger.kernel.org>
CC: Fedora Kernel Mailing list <fedora-kernel-list at redhat.com>

This patch fixes a regression that was introduced by the string based mounts. 

nfs_mount() statically returns -EACCES for every error returned
by the remote mounted. This is incorrect because -EACCES is
an non-fatal error to the mount.nfs command. This error causes
mount.nfs to retry the mount even in the case when the exported
directory does not exist. 

This patch maps the errors returned by the remote mountd into
valid errno values, exactly how it was done pre-string based 
mounts. By returning the correct errno enables mount.nfs 
to do the right thing.  

Signed-off-by: Steve Dickson <steved at redhat.com>
---

diff -up linux/fs/nfs/mount_clnt.c.orig linux/fs/nfs/mount_clnt.c
--- linux/fs/nfs/mount_clnt.c.orig	2008-04-09 08:32:43.000000000 -0400
+++ linux/fs/nfs/mount_clnt.c	2008-04-11 11:01:39.000000000 -0400
@@ -21,6 +21,49 @@
 
 static struct rpc_program	mnt_program;
 
+static struct {
+	enum nfs_stat stat;
+	int errnum;
+} mnt_errtbl[] = {
+	{ NFS_OK,		0		},
+	{ NFSERR_PERM,		EPERM		},
+	{ NFSERR_NOENT,		ENOENT		},
+	{ NFSERR_IO,		EIO		},
+	{ NFSERR_NXIO,		ENXIO		},
+	{ NFSERR_ACCES,		EACCES		},
+	{ NFSERR_EXIST,		EEXIST		},
+	{ NFSERR_NODEV,		ENODEV		},
+	{ NFSERR_NOTDIR,	ENOTDIR		},
+	{ NFSERR_ISDIR,		EISDIR		},
+#ifdef NFSERR_INVAL
+	{ NFSERR_INVAL,		EINVAL		},	/* that Sun forgot */
+#endif
+	{ NFSERR_FBIG,		EFBIG		},
+	{ NFSERR_NOSPC,		ENOSPC		},
+	{ NFSERR_ROFS,		EROFS		},
+	{ NFSERR_NAMETOOLONG,	ENAMETOOLONG	},
+	{ NFSERR_NOTEMPTY,	ENOTEMPTY	},
+	{ NFSERR_DQUOT,		EDQUOT		},
+	{ NFSERR_STALE,		ESTALE		},
+#ifdef EWFLUSH
+	{ NFSERR_WFLUSH,	EWFLUSH		},
+#endif
+	/* Throw in some NFSv3 values for even more fun (HP returns these) */
+	{ 71,			EREMOTE		},
+};
+static int mnt_errtbl_sz = sizeof(mnt_errtbl)/sizeof(mnt_errtbl[0]);
+
+static inline int mnt_err_map(int stat)
+{
+	int i;
+
+	for (i = 0; i < mnt_errtbl_sz; i++) {
+		if (mnt_errtbl[i].stat == stat)
+			return -mnt_errtbl[i].errnum;
+	}
+	return -EACCES;
+}
+
 struct mnt_fhstatus {
 	u32 status;
 	struct nfs_fh *fh;
@@ -98,7 +141,7 @@ out_call_err:
 
 out_mnt_err:
 	dprintk("NFS: MNT server returned result %d\n", result.status);
-	status = -EACCES;
+	status = mnt_err_map(result.status);
 	goto out;
 }
 

_______________________________________________
Fedora-kernel-list mailing list
Fedora-kernel-list at redhat.com
https://www.redhat.com/mailman/listinfo/fedora-kernel-list



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.606
retrieving revision 1.607
diff -u -r1.606 -r1.607
--- kernel.spec	12 Apr 2008 16:40:10 -0000	1.606
+++ kernel.spec	12 Apr 2008 16:46:48 -0000	1.607
@@ -611,6 +611,8 @@
 Patch681: linux-2.6-wireless-pending.patch
 Patch690: linux-2.6-at76.patch
 
+Patch700: linux-2.6-nfs-client-mounts-hang.patch
+
 Patch1101: linux-2.6-default-mmf_dump_elf_headers.patch
 Patch1400: linux-2.6-smarter-relatime.patch
 Patch1515: linux-2.6-lirc.patch
@@ -1121,6 +1123,9 @@
 # implement smarter atime updates support.
 ApplyPatch linux-2.6-smarter-relatime.patch
 
+# NFS Client mounts hang when exported directory do not exist
+ApplyPatch linux-2.6-nfs-client-mounts-hang.patch
+
 # build id related enhancements
 ApplyPatch linux-2.6-default-mmf_dump_elf_headers.patch
 
@@ -1751,6 +1756,9 @@
 
 %changelog
 * Sat Apr 12 2008 Dave Jones <davej at redhat.com>
+- Fix NFS Client mounts hang when exported directory do not exist
+
+* Sat Apr 12 2008 Dave Jones <davej at redhat.com>
 - Enable framepointers for better backtraces.
 
 * Fri Apr 11 2008 Chuck Ebbert <cebbert at redhat.com>




More information about the fedora-extras-commits mailing list