The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] xfs: propagate errors from xfs_rtginode_load
@ 2026-07-12  3:42 Guanghui Yang
  2026-07-12 16:22 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Guanghui Yang @ 2026-07-12  3:42 UTC (permalink / raw)
  To: linux-xfs
  Cc: Carlos Maiolino, Darrick J . Wong, Christoph Hellwig,
	linux-kernel, stable, Guanghui Yang

xfs_rtginode_ensure() treats every xfs_rtginode_load() error other than
-ENOENT as success.  This can leave the realtime group inode unset after an
I/O, allocation, or corruption error.  Growfs then continues as though the
inode had been loaded.

Only -ENOENT means that the inode needs to be created.  Return all other
errors to the growfs caller.

Fixes: ae897e0bed0f ("xfs: support creating per-RTG files in growfs")
Cc: stable@vger.kernel.org
Signed-off-by: Guanghui Yang <3497809730@qq.com>
---
 fs/xfs/xfs_rtalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 7a3f97686989..84efe5a8fb11 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -737,7 +737,7 @@ xfs_rtginode_ensure(
 	xfs_trans_cancel(tp);
 
 	if (error != -ENOENT)
-		return 0;
+		return error;
 	return xfs_rtginode_create(rtg, type, true);
 }
 
-- 
2.34.1


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

* Re: [PATCH] xfs: propagate errors from xfs_rtginode_load
  2026-07-12  3:42 [PATCH] xfs: propagate errors from xfs_rtginode_load Guanghui Yang
@ 2026-07-12 16:22 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2026-07-12 16:22 UTC (permalink / raw)
  To: Guanghui Yang
  Cc: linux-xfs, Carlos Maiolino, Christoph Hellwig, linux-kernel,
	stable

On Sun, Jul 12, 2026 at 03:42:56AM +0000, Guanghui Yang wrote:
> xfs_rtginode_ensure() treats every xfs_rtginode_load() error other than
> -ENOENT as success.  This can leave the realtime group inode unset after an
> I/O, allocation, or corruption error.  Growfs then continues as though the
> inode had been loaded.
> 
> Only -ENOENT means that the inode needs to be created.  Return all other
> errors to the growfs caller.
> 
> Fixes: ae897e0bed0f ("xfs: support creating per-RTG files in growfs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guanghui Yang <3497809730@qq.com>

Yeah, that's correct
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_rtalloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index 7a3f97686989..84efe5a8fb11 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -737,7 +737,7 @@ xfs_rtginode_ensure(
>  	xfs_trans_cancel(tp);
>  
>  	if (error != -ENOENT)
> -		return 0;
> +		return error;
>  	return xfs_rtginode_create(rtg, type, true);
>  }
>  
> -- 
> 2.34.1
> 

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12  3:42 [PATCH] xfs: propagate errors from xfs_rtginode_load Guanghui Yang
2026-07-12 16:22 ` Darrick J. Wong

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