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 <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2026-10-01 14:46:16 +09:30 committed by David Sterba
parent dd906477cc
commit 65583d4749

View 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;
}