diff options
author | Qu Wenruo <wqu@suse.com> | 2019-08-06 22:05:07 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 14:59:06 +0200 |
commit | 73798c465b66ed55d6f0adafbda42aca854acbf1 (patch) | |
tree | 08a4f8735dc6ac295de9cef30bca6e7f7d5734a3 /fs/btrfs/volumes.c | |
parent | 73a3ca20934dd02c0912bcf32463fffec6139399 (diff) |
btrfs: qgroup: Try our best to delete qgroup relations
When we try to delete qgroups, we're pretty cautious, we make sure both
qgroups exist and there is a relationship between them, then try to
delete the relation.
This behavior is OK, but the problem is we need to two relation items,
and if we failed the first item deletion, we error out, leaving the
other relation item in qgroup tree.
Sometimes the error from del_qgroup_relation_item() could just be
-ENOENT, thus we can ignore that error and continue without any problem.
Further more, such cautious behavior makes qgroup relation deletion
impossible for orphan relation items.
This patch will enhance __del_qgroup_relation():
- If both qgroups and their relation items exist
Go the regular deletion routine and update their accounting if needed.
- If any qgroup or relation item doesn't exist
Then we still try to delete the orphan items anyway, but don't trigger
the accounting update.
By this, we try our best to remove relation items, and can handle orphan
relation items properly, while still keep the existing behavior for good
qgroup tree.
Reported-by: Andrei Borzenkov <arvidjaar@gmail.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
0 files changed, 0 insertions, 0 deletions