Skip to content

Commit 6bf0231

Browse files
liubChris Mason
authored andcommitted
Btrfs: fix wrong check during log recovery
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 <[email protected]> Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Josef Bacik <[email protected]>
1 parent d3a9404 commit 6bf0231

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,7 @@ void btrfs_evict_inode(struct inode *inode)
37543754
btrfs_wait_ordered_range(inode, 0, (u64)-1);
37553755

37563756
if (root->fs_info->log_root_recovering) {
3757-
BUG_ON(!test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
3757+
BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
37583758
&BTRFS_I(inode)->runtime_flags));
37593759
goto no_delete;
37603760
}

0 commit comments

Comments
 (0)