Re: mount.nfs: cannot allocate memory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Yes. The ENOMEM is a red herring. It turns out that there is a bug in
nfs+AF8-xdev+AF8-mount that converts all errors from clone+AF8-server() into
ENOMEM...

The attached patch should fix it.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
www.netapp.com
From e718276d2a1704ac540f5037efac4ee55c2e6220 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
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@xxxxxxxxxx>
---
 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


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux