Commit f72388e3 authored by Qu Wenruo's avatar Qu Wenruo Committed by Greg Kroah-Hartman

btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf

[ Upstream commit 6f7de19e ]

Commit ff3d27a0 ("btrfs: qgroup: Finish rescan when hit the last leaf
of extent tree") added a new exit for rescan finish.

However after finishing quota rescan, we set
fs_info->qgroup_rescan_progress to (u64)-1 before we exit through the
original exit path.
While we missed that assignment of (u64)-1 in the new exit path.

The end result is, the quota status item doesn't have the same value.
(-1 vs the last bytenr + 1)
Although it doesn't affect quota accounting, it's still better to keep
the original behavior.
Reported-by: default avatarMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Fixes: ff3d27a0 ("btrfs: qgroup: Finish rescan when hit the last leaf of extent tree")
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3c92c7e9
......@@ -2603,8 +2603,10 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
}
btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem);
if (done && !ret)
if (done && !ret) {
ret = 1;
fs_info->qgroup_rescan_progress.objectid = (u64)-1;
}
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment