diff mbox

mount.nfs: cannot allocate memory.

Message ID 4FA345DA4F4AE44899BD2B03EEEC2FA9119BF981@SACEXCMBX04-PRD.hq.netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust Jan. 16, 2013, 8:14 p.m. UTC
On Wed, 2013-01-16 at 14:39 -0500, J. Bruce Fields wrote:
> On Wed, Jan 16, 2013 at 08:03:14PM +0100, Pawe? Sikora wrote:
> > [259176.973751] NFS: nfs mount opts='soft,addr=10.0.2.28,vers=3,proto=tcp,mountvers=3,mountproto=udp,mountport=50252'
> > [259176.973757] NFS:   parsing nfs mount option 'soft'
> > [259176.973759] NFS:   parsing nfs mount option 'addr=10.0.2.28'
> > [259176.973765] NFS:   parsing nfs mount option 'vers=3'
> > [259176.973769] NFS:   parsing nfs mount option 'proto=tcp'
> > [259176.973772] NFS:   parsing nfs mount option 'mountvers=3'
> > [259176.973776] NFS:   parsing nfs mount option 'mountproto=udp'
> > [259176.973779] NFS:   parsing nfs mount option 'mountport=50252'
> > [259176.973784] NFS: MNTPATH: '/R10'
> > [259176.973788] NFS: sending MNT request for nexus:/R10
> > [259176.974620] NFS: received 1 auth flavors
> > [259176.974623] NFS:   auth flavor[0]: 1
> > [259176.974640] NFS: MNT request succeeded
> > [259176.974643] NFS: using auth flavor 1
> > [259176.974688] --> nfs_init_server()
> > [259176.974691] --> nfs_get_client(nexus,v3)
> > [259176.974698] NFS: get client cookie (0xffff88021146f800/0xffff8800ceb06640)
> > [259176.975704] <-- nfs_init_server() = 0 [new ffff88021146f800]
> > [259176.975708] --> nfs_probe_fsinfo()
> > [259176.975711] NFS call  fsinfo
> > [259176.975959] NFS reply fsinfo: -116
> 
> That's ESTALE.  Might be interesting to see the network traffic between
> client and server.

Yes. The ENOMEM is a red herring. It turns out that there is a bug in
nfs_xdev_mount that converts all errors from clone_server() into
ENOMEM...

The attached patch should fix it.
diff mbox

Patch

From e718276d2a1704ac540f5037efac4ee55c2e6220 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Wed, 16 Jan 2013 15:05:44 -0500
Subject: [PATCH] NFS: Fix error reporting in nfs_xdev_mount

Currently, nfs_xdev_mount converts all errors from clone_server() to
ENOMEM. Fix that.
Also ensure that if nfs_fs_mount_common() returns an error, we
don't dprintk(0)...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/super.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 72cd2d2..befbae0 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2540,27 +2540,23 @@  nfs_xdev_mount(struct file_system_type *fs_type, int flags,
 	struct nfs_server *server;
 	struct dentry *mntroot = ERR_PTR(-ENOMEM);
 	struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod;
-	int error;
 
-	dprintk("--> nfs_xdev_mount_common()\n");
+	dprintk("--> nfs_xdev_mount()\n");
 
 	mount_info.mntfh = mount_info.cloned->fh;
 
 	/* create a new volume representation */
 	server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor);
-	if (IS_ERR(server)) {
-		error = PTR_ERR(server);
-		goto out_err;
-	}
 
-	mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod);
-	dprintk("<-- nfs_xdev_mount_common() = 0\n");
-out:
-	return mntroot;
+	if (IS_ERR(server))
+		mntroot = ERR_CAST(server);
+	else
+		mntroot = nfs_fs_mount_common(server, flags,
+				dev_name, &mount_info, nfs_mod);
 
-out_err:
-	dprintk("<-- nfs_xdev_mount_common() = %d [error]\n", error);
-	goto out;
+	dprintk("<-- nfs_xdev_mount() = %ld\n",
+			IS_ERR(mntroot) ? PTR_ERR(mntroot) : 0L);
+	return mntroot;
 }
 
 #if IS_ENABLED(CONFIG_NFS_V4)
-- 
1.7.11.7