diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2014-02-10 04:37:25 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fb.com> | 2014-03-10 15:16:38 -0400 |
commit | 7813b3db0a9ec77ff1f4b3ee3fb4925848395d59 (patch) | |
tree | 7c4b3e305c56b6dfdb541baa9322389d441f5321 /fs/btrfs/inode.c | |
parent | 2a85d9cac160bb5b845985a60007cc8348d77def (diff) |
Btrfs: avoid warning bomb of btrfs_invalidate_inodes
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b88f6221b48b..8dba152883d3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4926,7 +4926,8 @@ void btrfs_invalidate_inodes(struct btrfs_root *root) | |||
4926 | struct inode *inode; | 4926 | struct inode *inode; |
4927 | u64 objectid = 0; | 4927 | u64 objectid = 0; |
4928 | 4928 | ||
4929 | WARN_ON(btrfs_root_refs(&root->root_item) != 0); | 4929 | if (!test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) |
4930 | WARN_ON(btrfs_root_refs(&root->root_item) != 0); | ||
4930 | 4931 | ||
4931 | spin_lock(&root->inode_lock); | 4932 | spin_lock(&root->inode_lock); |
4932 | again: | 4933 | again: |