All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
@ 2018-06-27 10:19 Qu Wenruo
  2018-06-28  4:16 ` Misono Tomohiro
  2018-06-28 18:56 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2018-06-27 10:19 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 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: 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>
---
changelog:
v2:
  Commit message update, as the bug only changes the resulting quota status
  item without impacting the behavior.
---
 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] 3+ messages in thread

* Re: [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
  2018-06-27 10:19 [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf Qu Wenruo
@ 2018-06-28  4:16 ` Misono Tomohiro
  2018-06-28 18:56 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Misono Tomohiro @ 2018-06-28  4:16 UTC (permalink / raw)
  To: Qu Wenruo, linux-btrfs

On 2018/06/27 19:19, Qu Wenruo wrote:
> 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 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: 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>
> ---
> changelog:
> v2:
>   Commit message update, as the bug only changes the resulting quota status
>   item without impacting the behavior.


Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>

(As you said, the problem I reported in 
https://marc.info/?t=152999303500007&r=1&w=2 is not related to this change)

Thanks,
Tomohiro Misono

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
  2018-06-27 10:19 [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf Qu Wenruo
  2018-06-28  4:16 ` Misono Tomohiro
@ 2018-06-28 18:56 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-06-28 18:56 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, misono.tomohiro

On Wed, Jun 27, 2018 at 06:19:55PM +0800, Qu Wenruo wrote:
> 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 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: 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>

Thanks, added to 4.18 queue.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-28 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 10:19 [PATCH v1] btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf Qu Wenruo
2018-06-28  4:16 ` Misono Tomohiro
2018-06-28 18:56 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.