mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init()
@ 2026-10-26  5:34 Wilfred Mallawa
  2026-10-27 15:43 ` Christoph Hellwig
  2026-10-27 15:50 ` Carlos Maiolino
  0 siblings, 2 replies; 4+ messages in thread
From: Wilfred Mallawa @ 2026-10-26  5:34 UTC (permalink / raw)
  To: linux-xfs; +Cc: linux-kernel, Wilfred Mallawa

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

The goto for failing to setup /error/metadata jumps to the wrong place
in xfs_mount_sysfs_init(). Fix it.

Fixes: a9a7b9e8686d ("xfs: add support for lazy direct read bounce buffering")
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
 fs/xfs/xfs_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index e77917ac179d..4a6a8c92c3a1 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -906,7 +906,7 @@ xfs_mount_sysfs_init(
 				"metadata", &mp->m_error_meta_kobj,
 				xfs_error_meta_init);
 	if (error)
-		goto out_remove_csum_dir;
+		goto out_remove_error_dir;
 
 	return 0;
 
-- 
2.56.0


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

* Re: [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init()
  2026-10-26  5:34 [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init() Wilfred Mallawa
@ 2026-10-27 15:43 ` Christoph Hellwig
  2026-10-27 15:50 ` Carlos Maiolino
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-10-27 15:43 UTC (permalink / raw)
  To: Wilfred Mallawa; +Cc: linux-xfs, linux-kernel, Wilfred Mallawa

On Mon, Oct 26, 2026 at 03:34:55PM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> 
> The goto for failing to setup /error/metadata jumps to the wrong place
> in xfs_mount_sysfs_init(). Fix it.
> 
> Fixes: a9a7b9e8686d ("xfs: add support for lazy direct read bounce buffering")
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init()
  2026-10-26  5:34 [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init() Wilfred Mallawa
  2026-10-27 15:43 ` Christoph Hellwig
@ 2026-10-27 15:50 ` Carlos Maiolino
  2026-10-27 22:39   ` Wilfred Mallawa
  1 sibling, 1 reply; 4+ messages in thread
From: Carlos Maiolino @ 2026-10-27 15:50 UTC (permalink / raw)
  To: Wilfred Mallawa; +Cc: linux-xfs, linux-kernel, Wilfred Mallawa

On Mon, Oct 26, 2026 at 03:34:55PM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> 
> The goto for failing to setup /error/metadata jumps to the wrong place
> in xfs_mount_sysfs_init(). Fix it.
> 
> Fixes: a9a7b9e8686d ("xfs: add support for lazy direct read bounce buffering")
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> ---
>  fs/xfs/xfs_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index e77917ac179d..4a6a8c92c3a1 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -906,7 +906,7 @@ xfs_mount_sysfs_init(
>  				"metadata", &mp->m_error_meta_kobj,
>  				xfs_error_meta_init);
>  	if (error)
> -		goto out_remove_csum_dir;
> +		goto out_remove_error_dir;

Hmm. I think this is wrong. Don't we need to remove the fail_at_unmount
file *before* removing the kobject?

So, we'd need to actually call sysfs_remove_file() before actually
deleting the m_error_kobj.

I am honestly not sure if kobject_del would clean up any attributes
added there, but I think that's the right thing to do here?!

Cheers.

>  
>  	return 0;
>  
> -- 
> 2.56.0
> 
> 

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

* Re: [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init()
  2026-10-27 15:50 ` Carlos Maiolino
@ 2026-10-27 22:39   ` Wilfred Mallawa
  0 siblings, 0 replies; 4+ messages in thread
From: Wilfred Mallawa @ 2026-10-27 22:39 UTC (permalink / raw)
  To: cem; +Cc: linux-xfs, linux-kernel

On Tue, 2026-10-27 at 16:50 +0100, Carlos Maiolino wrote:
> On Mon, Oct 26, 2026 at 03:34:55PM +1000, Wilfred Mallawa wrote:
> > From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> > 
> > The goto for failing to setup /error/metadata jumps to the wrong
> > place
> > in xfs_mount_sysfs_init(). Fix it.
> > 
> > Fixes: a9a7b9e8686d ("xfs: add support for lazy direct read bounce
> > buffering")
> > Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> > ---
> >  fs/xfs/xfs_sysfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> > index e77917ac179d..4a6a8c92c3a1 100644
> > --- a/fs/xfs/xfs_sysfs.c
> > +++ b/fs/xfs/xfs_sysfs.c
> > @@ -906,7 +906,7 @@ xfs_mount_sysfs_init(
> >  				"metadata", &mp-
> > >m_error_meta_kobj,
> >  				xfs_error_meta_init);
> >  	if (error)
> > -		goto out_remove_csum_dir;
> > +		goto out_remove_error_dir;
> 
> Hmm. I think this is wrong. Don't we need to remove the
> fail_at_unmount
> file *before* removing the kobject?
> 
> So, we'd need to actually call sysfs_remove_file() before actually
> deleting the m_error_kobj.
> 
> I am honestly not sure if kobject_del would clean up any attributes
> added there, but I think that's the right thing to do here?!

With the xfs_sysfs_del(m_error_kobj), we end up in sysfs_remove_dir(()
which deletes any subdirs/files. So we *shoudn't* need to explicitly do
a per file remove?


Thanks!

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

end of thread, other threads:[~2026-10-27 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26  5:34 [PATCH] xfs: fix unwind handling during xfs_mount_sysfs_init() Wilfred Mallawa
2026-10-27 15:43 ` Christoph Hellwig
2026-10-27 15:50 ` Carlos Maiolino
2026-10-27 22:39   ` Wilfred Mallawa

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®