diff mbox

SQUASHME: pnfs: FIX stupid recall_layout BUG

Message ID 4D6A67F3.3060308@panasas.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Boaz Harrosh Feb. 27, 2011, 3:04 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 12ab7b3..34aee16 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -252,9 +252,9 @@  static int initiate_layout_draining(struct pnfs_cb_lrecall_info *cb_info)
 			if (nfs_compare_fh(&args->cbl_fh,
 					   &NFS_I(lo->plh_inode)->fh))
 				continue;
-			if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags))
+			if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
 				rv = NFS4ERR_DELAY;
-			else {
+			} else {
 				/* FIXME I need to better understand igrab and
 				 * does having a layout ref keep ino around?
 				 *  It should.
@@ -270,6 +270,11 @@  static int initiate_layout_draining(struct pnfs_cb_lrecall_info *cb_info)
 		}
 		spin_unlock(&clp->cl_lock);
 
+		if (rv == NFS4ERR_NOMATCHING_LAYOUT)
+			/* Nothing found */
+			return rv;
+
+		BUG_ON(!lo->plh_inode);
 		spin_lock(&lo->plh_inode->i_lock);
 		if (rv == NFS4_OK) {
 			lo->plh_block_lgets++;