[pnfs] [PATCH 05/11] nfs41: fix nfs4_init_session for v4.0

andros at netapp.com andros at netapp.com
Fri Jul 11 10:39:12 EDT 2008


From: Andy Adamson <andros at netapp.com>

Should be part of commit f772d9eeff4539174dff33be577ba26f47da55a9

Signed-off-by: Andy Adamson<andros at netapp.com>
---
 fs/nfs/client.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 252963d..ed2d4ca 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1137,7 +1137,7 @@ int nfs4_init_session(struct nfs_client *clp, struct nfs4_session **spp,
 		      struct rpc_clnt *clnt)
 {
 	int error = 0;
-	struct nfs4_session *session;
+	struct nfs4_session *session = NULL;
 
 	switch (clp->cl_minorversion) {
 	case 1:
@@ -1156,14 +1156,11 @@ int nfs4_init_session(struct nfs_client *clp, struct nfs4_session **spp,
 			error = xprt_setup_backchannel(clnt->cl_xprt,
 					NFS41_BC_MIN_CALLBACKS);
 			if (error < 0)
+				/* nfs4_put session sets the session to NULL */
 				nfs4_put_session(&session);
 		}
-		*spp = session;
-		break;
-	case 0:
-		session = NULL;
-		break;
 	}
+	*spp = session;
 	return error;
 }
 #endif /* CONFIG_NFS_V4_1 */
-- 
1.5.4.1



More information about the pNFS mailing list