[pnfs] [PATCH 1/5] nfs41: PNFS TREE VERSION check minorversion on nfs41_get_session

andros at netapp.com andros at netapp.com
Thu Oct 23 15:10:09 EDT 2008


From: Andy Adamson <andros at netapp.com>

Signed-off-by: Andy Adamson<andros at netapp.com>
---
 fs/nfs/client.c   |    2 +-
 fs/nfs/nfs4_fs.h  |    2 +-
 fs/nfs/nfs4proc.c |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c690218..5df2e37 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1366,7 +1366,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
 		nfs_init_server_aclclient(server);
 
 #ifdef CONFIG_NFS_V4_1
-	nfs4_get_session(server->nfs_client->cl_session);
+	nfs4_get_session(server->nfs_client);
 #endif /* CONFIG_NFS_V4_1 */
 
 	/* probe the filesystem info for this server filesystem */
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 73a865b..25c9886 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -202,7 +202,7 @@ extern int nfs4_setup_sequence(struct nfs_client *clp,
 	struct nfs41_sequence_args *args, struct nfs41_sequence_res *res,
 	int cache_reply, struct rpc_task *task);
 extern void nfs4_put_session(struct nfs4_session **session);
-extern void nfs4_get_session(struct nfs4_session *session);
+extern void nfs4_get_session(struct nfs_client *clp);
 extern struct nfs4_session *nfs4_alloc_session(void);
 extern int nfs4_proc_create_session(struct nfs4_session *, int reset);
 extern int nfs4_proc_destroy_session(struct nfs4_session *);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 9c3f83f..e6efca8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4803,9 +4803,10 @@ void nfs4_put_session(struct nfs4_session **session)
 }
 EXPORT_SYMBOL(nfs4_put_session);
 
-void nfs4_get_session(struct nfs4_session *session)
+void nfs4_get_session(struct nfs_client *clp)
 {
-	atomic_inc(&session->ref_count);
+	if (clp->cl_minorversion == 1)
+		atomic_inc(&clp->cl_session->ref_count);
 }
 
 /* Initialize the values to be used by the client in CREATE_SESSION */
-- 
1.5.4.3



More information about the pNFS mailing list