Skip to content

Commit

Permalink
Btrfs: avoid warning bomb of btrfs_invalidate_inodes
Browse files Browse the repository at this point in the history
So after transaction is aborted, we need to cleanup inode resources by
calling btrfs_invalidate_inodes(), and btrfs_invalidate_inodes() hopes
roots' refs to be zero in old times and sets a WARN_ON(), however, this
is not always true within cleaning up transaction, so we get to detect
transaction abortion and not warn at all.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
  • Loading branch information
Liu Bo authored and Josef Bacik committed Mar 10, 2014
1 parent 2a85d9c commit 7813b3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4926,7 +4926,8 @@ void btrfs_invalidate_inodes(struct btrfs_root *root)
struct inode *inode;
u64 objectid = 0;

WARN_ON(btrfs_root_refs(&root->root_item) != 0);
if (!test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state))
WARN_ON(btrfs_root_refs(&root->root_item) != 0);

spin_lock(&root->inode_lock);
again:
Expand Down

0 comments on commit 7813b3d

Please sign in to comment.