]> git.hungrycats.org Git - linux/commitdiff
btrfs: qgroup: use qgroup_mark_inconsistent() in quick_update_accounting()
authorQu Wenruo <wqu@suse.com>
Thu, 1 Oct 2026 05:16:16 +0000 (14:46 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 12 Oct 2026 17:16:24 +0000 (19:16 +0200)
When quick_update_accounting() fails to handle a qgroup which is not
fully exclusive (its exclusive number doesn't match the reference one),
we have to mark the qgroup inconsistent.

Unlike other locations we didn't use qgroup_mark_inconsistent(), thus
when such problem happens no extra error message is shown.

Use the helper in quick_update_accounting(), which does not only show
the reason of marking qgroup inconsistent, but also cancels any running
rescan and skips dirty accounting, avoiding wasting CPU time on already
inconsistent qgroup numbers.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c

index dfe3827ec3697031dd840b216e18ca5981e5b7b0..d3401a6df530fef2bc5871227be48df04aba1bfa 100644 (file)
@@ -1562,7 +1562,10 @@ static int quick_update_accounting(struct btrfs_fs_info *fs_info,
        }
 out:
        if (ret)
-               set_bit(BTRFS_QGROUP_STATUS_BIT_INCONSISTENT, &fs_info->qgroup_flags);
+               qgroup_mark_inconsistent(fs_info,
+       "unable to do quick excl updating for qgroup %hu/%llu, ret=%d",
+                                        btrfs_qgroup_level(src),
+                                        btrfs_qgroup_subvolid(src), ret);
        return ret;
 }