[pnfs] [PATCH 37/55] pnfsd: Do not hold state lock while recalling layouts.

andros at netapp.com andros at netapp.com
Tue Jul 7 16:39:03 EDT 2009


From: Dean Hildebrand <seattleplus at gmail.com>

Signed-off-by: Dean Hildebrand <dhildeb at us.ibm.com>
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfsd/nfs4state.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ce37c3d..4bcc9c3 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5181,11 +5181,13 @@ nomatching_layout(struct super_block *sb, struct nfs4_layoutrecall *clr)
 	lr.lr_reclaim = 0;
 	lr.lr_flags = LR_FLAG_INTERN;
 
+	nfs4_lock_state();
 	if (clr->cb.cbl_recall_type == RECALL_FILE)
 		pnfs_return_file_layouts(clr->clr_client, clr->clr_file, &lr);
 	else
 		pnfs_return_client_layouts(clr->clr_client, &lr,
 					   clr->cb.cbl_fsid.major);
+	nfs4_unlock_state();
 }
 
 /*
@@ -5263,7 +5265,8 @@ out:
 }
 
 /*
- * Recall a layout synchronously
+ * Recall a layout synchronously.
+ * Called with state lock.
  */
 static void
 sync_layout_recall(struct super_block *sb, struct list_head *todolist)
@@ -5297,7 +5300,10 @@ sync_layout_recall(struct super_block *sb, struct list_head *todolist)
 		list_add(&pending->clr_perclnt,
 			 &pending->clr_client->cl_layoutrecalls);
 
+		/* Unlock while issuing call to client */
+		nfs4_unlock_state();
 		status = nfsd4_cb_layout(pending);
+		nfs4_lock_state();
 		if (status) {
 			printk("%s: clp %p cb_client %p fp %p "
 			       "failed with status %d\n", __func__,
-- 
1.5.4.3



More information about the pNFS mailing list