Skip to content

Commit f13342e

Browse files
boryaskdave
authored andcommitted
btrfs: swallow btrfs_record_squota_delta() ENOENT
I thought that it was likely I could harden squota deletion to the point that it was impossible to end up with an extent accounted to a qgroup outliving its qgroup. Several recent bugs have made me re-consider that position. Ultimately, this is a tradeoff between short term stability and long term strictness, but I think given that there could be another layer of bugs behind the 2-3 I just fixed, I would feel much more confident in people using squotas if the risk was "your values can get a bit out of whack which you can fix by deleting stuff or disabling/re-enabling/repairing" vs "it will abort your filesystem". As the final nail in the coffin, the Meta production kernel was lacking earlier fixes from me and Qu regarding subvol qgroup lifetime, so this is what we have been testing at scale, so I think at least for now upstream should have the same extra layer of protection. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Boris Burkov <boris@bur.io> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 99aacd1 commit f13342e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fs/btrfs/qgroup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4957,8 +4957,9 @@ int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
49574957

49584958
spin_lock(&fs_info->qgroup_lock);
49594959
qgroup = find_qgroup_rb(fs_info, root);
4960-
if (!qgroup) {
4961-
ret = -ENOENT;
4960+
if (WARN_ON_ONCE(!qgroup)) {
4961+
btrfs_warn(fs_info, "squota failed to find qgroup for root %llu", root);
4962+
ret = 0;
49624963
goto out;
49634964
}
49644965

0 commit comments

Comments
 (0)