* [PATCH] btrfs: quota: Reset rescan progress if we hit last leaf
@ 2018-06-27 8:48 Qu Wenruo
0 siblings, 0 replies; only message in thread
From: Qu Wenruo @ 2018-06-27 8:48 UTC (permalink / raw)
To: linux-btrfs; +Cc: misono.tomohiro
Commit ff3d27a048d9 ("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, as qgroup_rescan_progress is also
used to determine whether we should account dirty extents.
Since if dirty extents is after qgroup_rescan_progress, we don't need to
account it as rescan will account them later.
Without properly setting qgroup_rescan_progress to (u64)-1, all later
dirty extents after qgroup_rescan_progress will be ignored, thus
screwing up the whole quota accounting.
Reported-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Fixes: ff3d27a048d9 ("btrfs: qgroup: Finish rescan when hit the last leaf of extent tree")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/qgroup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 1874a6d2e6f5..99f2b9ce0f15 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2680,8 +2680,10 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
free_extent_buffer(scratch_leaf);
}
- if (done && !ret)
+ if (done && !ret) {
ret = 1;
+ fs_info->qgroup_rescan_progress.objectid = (u64)-1;
+ }
return ret;
}
--
2.18.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-06-27 8:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-27 8:48 [PATCH] btrfs: quota: Reset rescan progress if we hit last leaf Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).