Whamcloud - gitweb
LU-118: clear_inode: BUG_ON(inode->i_data.nrpages)
authorJinshan Xiong <jay@whamcloud.com>
Fri, 3 Jun 2011 22:12:33 +0000 (15:12 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 6 Jun 2011 15:34:25 +0000 (08:34 -0700)
This is a workaround patch to fix the problem. This patch should be gone
after there is a fix appearing in mainstream kernel.

Change-Id: I5a78ecae626e5d82cd9eac5dc2c2b849d4afd368
Signed-off-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/879
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_lib.c

index fa067c7..fd6e976 100644 (file)
@@ -1723,10 +1723,23 @@ void ll_delete_inode(struct inode *inode)
         ENTRY;
 
         rc = obd_fid_delete(sbi->ll_md_exp, ll_inode2fid(inode));
-        if (rc) {
+        if (rc)
                 CERROR("fid_delete() failed, rc %d\n", rc);
-        }
+
         truncate_inode_pages(&inode->i_data, 0);
+
+        /* Workaround for LU-118 */
+        if (inode->i_data.nrpages) {
+                TREE_READ_LOCK_IRQ(&inode->i_data);
+                TREE_READ_UNLOCK_IRQ(&inode->i_data);
+                LASSERTF(inode->i_data.nrpages == 0,
+                         "inode=%lu/%u(%p) nrpages=%lu, see "
+                         "http://jira.whamcloud.com/browse/LU-118\n",
+                         inode->i_ino, inode->i_generation, inode,
+                         inode->i_data.nrpages);
+        }
+        /* Workaround end */
+
         clear_inode(inode);
 
         EXIT;