[pnfs] [PATCH 07/10] pnfs: only release layout for RECALL_FILE case

andros at netapp.com andros at netapp.com
Wed May 7 16:53:42 EDT 2008


From: Andy Adamson <andros at umich.edu>

The layout lock is only taken in the RECALL_FILE case, so only release it
in the RECALL_FILE case.

Signed-off-by: Andy Adamson<andros at netapp.com>
---
 fs/nfs/nfs4proc.c |   11 +++++++----
 fs/nfs/pnfs.c     |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index cd1eee8..69d78b9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5275,11 +5275,14 @@ static void nfs4_pnfs_layoutreturn_release(void *calldata)
 	struct nfs_inode *nfsi = NFS_I(lrp->args.inode);
 	struct pnfs_layout_type *lo;
 
-	lo = nfsi->current_layout;
-	BUG_ON(!lo);
+	dprintk("--> %s nfsi->current_layout %p\n", __func__,
+					nfsi->current_layout);
 
-	dprintk("--> %s\n", __func__);
-	pnfs_layout_release(lo);
+	if (lrp->args.return_type == RECALL_FILE) {
+		lo = nfsi->current_layout;
+		BUG_ON(!lo);
+		pnfs_layout_release(lo);
+	}
 	kfree(calldata);
 	dprintk("<-- %s\n", __func__);
 }
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 41950df..ec755ec 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -569,7 +569,7 @@ pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
 	struct nfs4_pnfs_layout_segment arg;
 	int status;
 
-	dprintk("--> %s\n", __func__);
+	dprintk("--> %s type %d\n", __func__, type);
 
 	if (range)
 		arg = *range;
-- 
1.5.4.1



More information about the pNFS mailing list