From: Qu Wenruo Date: Thu, 1 Oct 2026 05:16:16 +0000 (+0930) Subject: btrfs: qgroup: use qgroup_mark_inconsistent() in quick_update_accounting() X-Git-Tag: v7.4-rc1~87^2~37 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65583d4749af1bede388425b5ab70cb6cbb68125;p=linux btrfs: qgroup: use qgroup_mark_inconsistent() in quick_update_accounting() 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 Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index dfe3827ec3697..d3401a6df530f 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -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; }