diff mbox

SQUASHME: pnfs: fix lock inversion in pnfs_layout_process

Message ID 1298396849-19340-1-git-send-email-bhalevy@panasas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy Feb. 22, 2011, 5:47 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 5a47b76..c184e41 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1045,7 +1045,6 @@  pnfs_layout_process(struct nfs4_layoutget *lgp)
 		goto out;
 	}
 
-	spin_lock(&ino->i_lock);
 	/* decrement needs to be done before call to pnfs_layoutget_blocked */
 	atomic_dec(&lo->plh_outstanding);
 	spin_lock(&clp->cl_lock);
@@ -1056,6 +1055,7 @@  pnfs_layout_process(struct nfs4_layoutget *lgp)
 	}
 	spin_unlock(&clp->cl_lock);
 
+	spin_lock(&ino->i_lock);
 	if (pnfs_layoutgets_blocked(lo, &res->stateid)) {
 		dprintk("%s forget reply due to state\n", __func__);
 		goto out_forget_reply;