Linux XFS filesystem development
 help / color / mirror / Atom feed
* Re: [PATCH 6.18 0805/1005] xfs: cross-reference the primary superblock
       [not found] <20261104211105.901372401@linuxfoundation.org>
@ 2026-11-06  7:17 ` Miguel Ojeda
  0 siblings, 0 replies; only message in thread
From: Miguel Ojeda @ 2026-11-06  7:17 UTC (permalink / raw)
  To: gregkh
  Cc: cem, djwong, hch, patches, stable, linux-xfs, Huacai Chen,
	WANG Xuerui, loongarch

On Wed, 04 Nov 2026 16:08:58 -0500 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
>  	int			error;

> +	if (agno == 0)
> +		goto out_xref;
> +
>  	error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp);

> +out_xref:
> +	xchk_superblock_xref(sc);
>  out_pag:
>  	xfs_perag_put(pag);
>  	return error;

In loongarch64, like in 7.13.y, I am also seeing the following due to
the code above:

    fs/xfs/scrub/agheader.c:123:6: warning: variable 'error' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      123 |         if (agno == 0)
          |             ^~~~~~~~~
    fs/xfs/scrub/agheader.c:435:9: note: uninitialized use occurs here
      435 |         return error;
          |                ^~~~~
    fs/xfs/scrub/agheader.c:123:2: note: remove the 'if' if its condition is always false
      123 |         if (agno == 0)
          |         ^~~~~~~~~~~~~~
      124 |                 goto out_xref;
          |                 ~~~~~~~~~~~~~
    fs/xfs/scrub/agheader.c:111:13: note: initialize the variable 'error' to silence this warning
      111 |         int                     error;
          |                                      ^
          |                                       = 0

It seems this happened in mainline too, but `error` got initialized in
a later commit:

  612d2e7506c3 ("xfs: read primary superblock from disk during scrub")

So something needs to be changed for stable.

Cc: Carlos Maiolino <cem@kernel.org>
Cc: linux-xfs@vger.kernel.org
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>

Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: loongarch@lists.linux.dev

Cheers,
Miguel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-06  7:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261104211105.901372401@linuxfoundation.org>
2026-11-06  7:17 ` [PATCH 6.18 0805/1005] xfs: cross-reference the primary superblock Miguel Ojeda

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