mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n
@ 2026-07-22  4:28 Yun Zhou
  2026-07-22  8:49 ` Carlos Maiolino
  0 siblings, 1 reply; 5+ messages in thread
From: Yun Zhou @ 2026-07-22  4:28 UTC (permalink / raw)
  To: cem; +Cc: djwong, hch, linux-xfs, linux-kernel

When CONFIG_XFS_RT is disabled, xfs_log_rtsb() is a macro expanding to
(NULL), causing 'statement with no effect' and 'variable set but not
used' warnings.

Fix by removing the bp variable and passing xfs_trans_getsb(tp) directly
to xfs_log_rtsb().  This is safe because xfs_log_sb() already joins the
sb buffer to the transaction internally.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607212237.Pzw1sr5k-lkp@intel.com/
Fixes: b9ad0b9891dd ("xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf")
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
---
 fs/xfs/libxfs/xfs_sb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index fbb4505b1e9e..c4fa7fb0e39a 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -1470,17 +1470,15 @@ xfs_sync_sb_buf(
 	bool			update_rtsb)
 {
 	struct xfs_trans	*tp;
-	struct xfs_buf		*bp;
 	int			error;
 
 	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp);
 	if (error)
 		return error;
 
-	bp = xfs_trans_getsb(tp);
 	xfs_log_sb(tp);
 	if (update_rtsb)
-		xfs_log_rtsb(tp, bp);
+		(void)xfs_log_rtsb(tp, xfs_trans_getsb(tp));
 	xfs_trans_set_sync(tp);
 	error = xfs_trans_commit(tp);
 	if (error)
-- 
2.43.0


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

* Re: [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n
  2026-07-22  4:28 [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n Yun Zhou
@ 2026-07-22  8:49 ` Carlos Maiolino
  2026-07-22  8:58   ` Christoph Hellwig
  2026-07-22  9:11   ` Zhou, Yun
  0 siblings, 2 replies; 5+ messages in thread
From: Carlos Maiolino @ 2026-07-22  8:49 UTC (permalink / raw)
  To: Yun Zhou; +Cc: djwong, hch, linux-xfs, linux-kernel

On Wed, Jul 22, 2026 at 12:28:41PM +0800, Yun Zhou wrote:
> When CONFIG_XFS_RT is disabled, xfs_log_rtsb() is a macro expanding to
> (NULL), causing 'statement with no effect' and 'variable set but not
> used' warnings.
> 
> Fix by removing the bp variable and passing xfs_trans_getsb(tp) directly
> to xfs_log_rtsb().  This is safe because xfs_log_sb() already joins the
> sb buffer to the transaction internally.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607212237.Pzw1sr5k-lkp@intel.com/
> Fixes: b9ad0b9891dd ("xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf")
> Signed-off-by: Yun Zhou <yun.zhou@windriver.com>

We don't need a fix for a patch that is still in linux-next... Merge it
against your original patch and re-send it. I'll just replace the old
patch


> ---
>  fs/xfs/libxfs/xfs_sb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index fbb4505b1e9e..c4fa7fb0e39a 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -1470,17 +1470,15 @@ xfs_sync_sb_buf(
>  	bool			update_rtsb)
>  {
>  	struct xfs_trans	*tp;
> -	struct xfs_buf		*bp;
>  	int			error;
>  
>  	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp);
>  	if (error)
>  		return error;
>  
> -	bp = xfs_trans_getsb(tp);
>  	xfs_log_sb(tp);
>  	if (update_rtsb)
> -		xfs_log_rtsb(tp, bp);
> +		(void)xfs_log_rtsb(tp, xfs_trans_getsb(tp));
>  	xfs_trans_set_sync(tp);
>  	error = xfs_trans_commit(tp);
>  	if (error)
> -- 
> 2.43.0
> 
> 

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

* Re: [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n
  2026-07-22  8:49 ` Carlos Maiolino
@ 2026-07-22  8:58   ` Christoph Hellwig
  2026-07-22  9:22     ` Zhou, Yun
  2026-07-22  9:11   ` Zhou, Yun
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-07-22  8:58 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: Yun Zhou, djwong, hch, linux-xfs, linux-kernel

On Wed, Jul 22, 2026 at 10:49:03AM +0200, Carlos Maiolino wrote:
> We don't need a fix for a patch that is still in linux-next... Merge it
> against your original patch and re-send it. I'll just replace the old
> patch

And please turn the stub into an inline function to avoid the ugly
void casting.


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

* Re: [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n
  2026-07-22  8:49 ` Carlos Maiolino
  2026-07-22  8:58   ` Christoph Hellwig
@ 2026-07-22  9:11   ` Zhou, Yun
  1 sibling, 0 replies; 5+ messages in thread
From: Zhou, Yun @ 2026-07-22  9:11 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: djwong, hch, linux-xfs, linux-kernel



On 7/22/26 16:49, Carlos Maiolino wrote:
> On Wed, Jul 22, 2026 at 12:28:41PM +0800, Yun Zhou wrote:
>> When CONFIG_XFS_RT is disabled, xfs_log_rtsb() is a macro expanding to
>> (NULL), causing 'statement with no effect' and 'variable set but not
>> used' warnings.
>>
>> Fix by removing the bp variable and passing xfs_trans_getsb(tp) directly
>> to xfs_log_rtsb().  This is safe because xfs_log_sb() already joins the
>> sb buffer to the transaction internally.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202607212237.Pzw1sr5k-lkp@intel.com/
>> Fixes: b9ad0b9891dd ("xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf")
>> Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
> 
> We don't need a fix for a patch that is still in linux-next... Merge it
> against your original patch and re-send it. I'll just replace the old
> patch
> 

Okay, I will resend v2 as requested. Sorry for the inconvenience.

BR,
Yun

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

* Re: [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n
  2026-07-22  8:58   ` Christoph Hellwig
@ 2026-07-22  9:22     ` Zhou, Yun
  0 siblings, 0 replies; 5+ messages in thread
From: Zhou, Yun @ 2026-07-22  9:22 UTC (permalink / raw)
  To: Christoph Hellwig, Carlos Maiolino; +Cc: djwong, linux-xfs, linux-kernel



On 7/22/26 16:58, Christoph Hellwig wrote:
> On Wed, Jul 22, 2026 at 10:49:03AM +0200, Carlos Maiolino wrote:
>> We don't need a fix for a patch that is still in linux-next... Merge it
>> against your original patch and re-send it. I'll just replace the old
>> patch
> 
> And please turn the stub into an inline function to avoid the ugly
> void casting.
> 

Okay, I fold the inline function conversion into v2.

Thanks,
Yun

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

end of thread, other threads:[~2026-07-22  9:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22  4:28 [PATCH] xfs: fix compilation warnings in xfs_sync_sb_buf when CONFIG_XFS_RT=n Yun Zhou
2026-07-22  8:49 ` Carlos Maiolino
2026-07-22  8:58   ` Christoph Hellwig
2026-07-22  9:22     ` Zhou, Yun
2026-07-22  9:11   ` Zhou, Yun

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

all inboxes | Powered by JetHome®