public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [next] xfs: remove the redundant xfs_alloc_log_agf
@ 2024-09-30 10:42 Long Li
  2024-09-30 12:55 ` Carlos Maiolino
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Long Li @ 2024-09-30 10:42 UTC (permalink / raw)
  To: djwong, chandanbabu
  Cc: linux-xfs, david, yi.zhang, houtao1, leo.lilong, yangerkun

There are two invocations of xfs_alloc_log_agf in xfs_alloc_put_freelist.
The AGF does not change between the two calls. Although this does not pose
any practical problems, it seems like a small mistake. Therefore, fix it
by removing the first xfs_alloc_log_agf invocation.

Signed-off-by: Long Li <leo.lilong@huawei.com>
---
 fs/xfs/libxfs/xfs_alloc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 59326f84f6a5..cce32b2f3ffd 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -3159,8 +3159,6 @@ xfs_alloc_put_freelist(
 		logflags |= XFS_AGF_BTREEBLKS;
 	}
 
-	xfs_alloc_log_agf(tp, agbp, logflags);
-
 	ASSERT(be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp));
 
 	agfl_bno = xfs_buf_to_agfl_bno(agflbp);
-- 
2.39.2


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

* Re: [next] xfs: remove the redundant xfs_alloc_log_agf
  2024-09-30 10:42 [next] xfs: remove the redundant xfs_alloc_log_agf Long Li
@ 2024-09-30 12:55 ` Carlos Maiolino
  2024-10-08  2:19   ` Long Li
  2024-09-30 23:19 ` Dave Chinner
  2024-10-11  7:44 ` Carlos Maiolino
  2 siblings, 1 reply; 5+ messages in thread
From: Carlos Maiolino @ 2024-09-30 12:55 UTC (permalink / raw)
  To: Long Li; +Cc: djwong, chandanbabu, linux-xfs, david, yi.zhang, houtao1,
	yangerkun

Hello.

What do you mean with the [next] tag in the subject, instead of usual [PATCH]
tag?

On Mon, Sep 30, 2024 at 06:42:17PM GMT, Long Li wrote:
> There are two invocations of xfs_alloc_log_agf in xfs_alloc_put_freelist.
> The AGF does not change between the two calls. Although this does not pose
> any practical problems, it seems like a small mistake. Therefore, fix it
> by removing the first xfs_alloc_log_agf invocation.
> 
> Signed-off-by: Long Li <leo.lilong@huawei.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 59326f84f6a5..cce32b2f3ffd 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -3159,8 +3159,6 @@ xfs_alloc_put_freelist(
>  		logflags |= XFS_AGF_BTREEBLKS;
>  	}
>  
> -	xfs_alloc_log_agf(tp, agbp, logflags);
> -

Hmm.. Isn't this logged twice because of lazy-count?


Carlos


>  	ASSERT(be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp));
>  
>  	agfl_bno = xfs_buf_to_agfl_bno(agflbp);
> -- 
> 2.39.2
> 
> 

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

* Re: [next] xfs: remove the redundant xfs_alloc_log_agf
  2024-09-30 10:42 [next] xfs: remove the redundant xfs_alloc_log_agf Long Li
  2024-09-30 12:55 ` Carlos Maiolino
@ 2024-09-30 23:19 ` Dave Chinner
  2024-10-11  7:44 ` Carlos Maiolino
  2 siblings, 0 replies; 5+ messages in thread
From: Dave Chinner @ 2024-09-30 23:19 UTC (permalink / raw)
  To: Long Li; +Cc: djwong, chandanbabu, linux-xfs, yi.zhang, houtao1, yangerkun

[ Your email is being being classified as spam by gmail because it
does not have a valid DKIM authentication signature.  Hence it
doesn't get delivered to anyone who's mail is backed by gmail.... ]

On Mon, Sep 30, 2024 at 06:42:17PM +0800, Long Li wrote:
> There are two invocations of xfs_alloc_log_agf in xfs_alloc_put_freelist.
> The AGF does not change between the two calls. Although this does not pose
> any practical problems, it seems like a small mistake. Therefore, fix it
> by removing the first xfs_alloc_log_agf invocation.
> 
> Signed-off-by: Long Li <leo.lilong@huawei.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 59326f84f6a5..cce32b2f3ffd 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -3159,8 +3159,6 @@ xfs_alloc_put_freelist(
>  		logflags |= XFS_AGF_BTREEBLKS;
>  	}
>  
> -	xfs_alloc_log_agf(tp, agbp, logflags);
> -

Looks fine. That's been there since commit 92821e2ba4ae ("[XFS] Lazy
Superblock Counters") was merged back in 2007...

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

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

* Re: [next] xfs: remove the redundant xfs_alloc_log_agf
  2024-09-30 12:55 ` Carlos Maiolino
@ 2024-10-08  2:19   ` Long Li
  0 siblings, 0 replies; 5+ messages in thread
From: Long Li @ 2024-10-08  2:19 UTC (permalink / raw)
  To: Carlos Maiolino
  Cc: djwong, chandanbabu, linux-xfs, david, yi.zhang, houtao1,
	yangerkun

On Mon, Sep 30, 2024 at 02:55:47PM +0200, Carlos Maiolino wrote:
> Hello.
> 
> What do you mean with the [next] tag in the subject, instead of usual [PATCH]
> tag?

I intended to use [PATCH-next] in the subject, but I made a mistake. Do I
need to resend?

> 
> On Mon, Sep 30, 2024 at 06:42:17PM GMT, Long Li wrote:
> > There are two invocations of xfs_alloc_log_agf in xfs_alloc_put_freelist.
> > The AGF does not change between the two calls. Although this does not pose
> > any practical problems, it seems like a small mistake. Therefore, fix it
> > by removing the first xfs_alloc_log_agf invocation.
> > 
> > Signed-off-by: Long Li <leo.lilong@huawei.com>
> > ---
> >  fs/xfs/libxfs/xfs_alloc.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> > index 59326f84f6a5..cce32b2f3ffd 100644
> > --- a/fs/xfs/libxfs/xfs_alloc.c
> > +++ b/fs/xfs/libxfs/xfs_alloc.c
> > @@ -3159,8 +3159,6 @@ xfs_alloc_put_freelist(
> >  		logflags |= XFS_AGF_BTREEBLKS;
> >  	}
> >  
> > -	xfs_alloc_log_agf(tp, agbp, logflags);
> > -
> 
> Hmm.. Isn't this logged twice because of lazy-count?
> 
> 
> Carlos
> 

I think that logging twice is unrelated to the lazy superblock count,
as the lazy superblock count is rebuilt using information from the AGF.
We only need to log AGF normally, not twice.

Thanks,
Long Li

> 
> >  	ASSERT(be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp));
> >  
> >  	agfl_bno = xfs_buf_to_agfl_bno(agflbp);
> > -- 
> > 2.39.2
> > 
> > 

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

* Re: [next] xfs: remove the redundant xfs_alloc_log_agf
  2024-09-30 10:42 [next] xfs: remove the redundant xfs_alloc_log_agf Long Li
  2024-09-30 12:55 ` Carlos Maiolino
  2024-09-30 23:19 ` Dave Chinner
@ 2024-10-11  7:44 ` Carlos Maiolino
  2 siblings, 0 replies; 5+ messages in thread
From: Carlos Maiolino @ 2024-10-11  7:44 UTC (permalink / raw)
  To: djwong, chandanbabu, Long Li
  Cc: linux-xfs, david, yi.zhang, houtao1, yangerkun

On Mon, 30 Sep 2024 18:42:17 +0800, Long Li wrote:
> There are two invocations of xfs_alloc_log_agf in xfs_alloc_put_freelist.
> The AGF does not change between the two calls. Although this does not pose
> any practical problems, it seems like a small mistake. Therefore, fix it
> by removing the first xfs_alloc_log_agf invocation.
> 
> 

Applied to for-next, thanks!

[1/1] xfs: remove the redundant xfs_alloc_log_agf
      (no commit info)

Best regards,
-- 
Carlos Maiolino <cem@kernel.org>


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

end of thread, other threads:[~2024-10-11  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 10:42 [next] xfs: remove the redundant xfs_alloc_log_agf Long Li
2024-09-30 12:55 ` Carlos Maiolino
2024-10-08  2:19   ` Long Li
2024-09-30 23:19 ` Dave Chinner
2024-10-11  7:44 ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox