OSDN Git Service

btrfs: Ignore errors from btrfs_qgroup_trace_extent_post
authorNikolay Borisov <nborisov@suse.com>
Mon, 29 Jan 2018 13:53:01 +0000 (15:53 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Feb 2018 15:25:14 +0000 (16:25 +0100)
commit952bd3db0dada9994fa7edd891178075abcc045d
tree3921acea6d28b5eccb54fc01d6ee70a7e901f0d6
parent900c9981680067573671ecc5cbfa7c5770be3a40
btrfs: Ignore errors from btrfs_qgroup_trace_extent_post

Running generic/019 with qgroups on the scratch device enabled is almost
guaranteed to trigger the BUG_ON in btrfs_free_tree_block. It's supposed
to trigger only on -ENOMEM, in reality, however, it's possible to get
-EIO from btrfs_qgroup_trace_extent_post. This function just finds the
roots of the extent being tracked and sets the qrecord->old_roots list.
If this operation fails nothing critical happens except the quota
accounting can be considered wrong. In such case just set the
INCONSISTENT flag for the quota and print a warning, rather than killing
off the system. Additionally, it's possible to trigger a BUG_ON in
btrfs_truncate_inode_items as well.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
[ error message adjustments ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c
fs/btrfs/qgroup.c