]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: qgroup: catch reserved space leaks at unmount time
authorQu Wenruo <wqu@suse.com>
Wed, 10 Jun 2020 01:04:44 +0000 (09:04 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:24 +0000 (12:55 +0200)
commitd49f1b1726a28fc768c7258993da4501ce9b5f40
tree48bfae278ccd1eee63fc946d27f615f3ae6b8d5d
parentae74616aa65b497b7ac7194d26a9e5e2c405e74a
btrfs: qgroup: catch reserved space leaks at unmount time

Before this patch, qgroup completely relies on per-inode extent io tree
to detect reserved data space leak.

However previous bug has already shown how release page before
btrfs_finish_ordered_io() could lead to leak, and since it's
QGROUP_RESERVED bit cleared without triggering qgroup rsv, it can't be
detected by per-inode extent io tree.

So this patch adds another (and hopefully the final) safety net to catch
qgroup data reserved space leak.  At least the new safety net catches
all the leaks during development, so it should be pretty useful in the
real world.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h