]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Btrfs: fix wrong check during log recovery
authorLiu Bo <liubo2009@cn.fujitsu.com>
Tue, 26 Jun 2012 03:59:09 +0000 (21:59 -0600)
committerChris Mason <chris.mason@fusionio.com>
Mon, 2 Jul 2012 19:39:17 +0000 (15:39 -0400)
When we're evicting an inode during log recovery, we need to ensure that the inode
is not in orphan state any more, which means inode's run_time flags has _no_
BTRFS_INODE_HAS_ORPHAN_ITEM.  Thus, the BUG_ON was triggered because of a wrong
check for the flags.

Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c

index 6971fb5fc85938b9557223490b7878d6eda0d56c..9f07bd121f6671db2ddfec0f5b41a3cc2d577c99 100644 (file)
@@ -3754,7 +3754,7 @@ void btrfs_evict_inode(struct inode *inode)
        btrfs_wait_ordered_range(inode, 0, (u64)-1);
 
        if (root->fs_info->log_root_recovering) {
-               BUG_ON(!test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
+               BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
                                 &BTRFS_I(inode)->runtime_flags));
                goto no_delete;
        }