xfs: fix unwind handling during xfs_mount_sysfs_init()
PATCH 1/1 xfs: fix unwind handling during xfs_mount_sysfs_init()
From: Wilfred Mallawa <[email protected]>
The goto for failing to setup /error/metadata jumps to the wrong place in xfs_mount_sysfs_init(). Fix it.
--- fs/xfs/xfs_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_sysfs.c +1 -1
@@ -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 ;
Signature · 1 line
2.56.0
Quoted 7 lines · Wilfred Mallawa
From: Wilfred Mallawa <[email protected]>
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 <[email protected]>
Looks good:
Carlos Maiolino
maintainerQuoted 16 lines · Wilfred Mallawa
From: Wilfred Mallawa <[email protected]>
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 <[email protected]>--- fs/xfs/xfs_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_sysfs.c +0
-0
fs/xfs/xfs_sysfs.c xfs_mount_sysfs_init( · line 909
Quoted 5 lines
fs/xfs/xfs_sysfs.c +1
-1@@ -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.
Quoted 7 lines
fs/xfs/xfs_sysfs.c +0
-0return 0 ;Signature · 1 line
2.56.0
Quoted 30 lines · Carlos Maiolino
Quoted 22 lines · Wilfred Mallawa
From: Wilfred Mallawa <[email protected]>
The goto for failing to setup /error/metadata jumps to the wrong place
inxfs_mount_sysfs_init(). Fix it.Fixes a9a7b9e8686d ("xfs: add support for lazy direct read bouncebuffering")
Signed-off-by Wilfred Mallawa <[email protected]>---
fs/xfs/xfs_sysfs.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_sysfs.c +0
-0@@ -906,7 +906,7 @@ xfs_mount_sysfs_init("metadata", &mp-
Quoted 1 line
m_error_meta_kobj,
xfs_error_meta_init); if (error)fs/xfs/xfs_sysfs.c xfs_mount_sysfs_init( · line 909
Quoted 2 lines
fs/xfs/xfs_sysfs.c +1
-1- 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?
Quoted 5 lines
So, we'd need to actually call
sysfs_remove_file()before actually deleting them_error_kobj.I am honestly not sure if
kobject_delwould 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!
Quoted 34 lines · Wilfred Mallawa
Quoted 33 lines · Carlos Maiolino
Quoted 22 lines · Wilfred Mallawa
From: Wilfred Mallawa <[email protected]>
The goto for failing to setup /error/metadata jumps to the wrong place
inxfs_mount_sysfs_init(). Fix it.Fixes a9a7b9e8686d ("xfs: add support for lazy direct read bouncebuffering")
Signed-off-by Wilfred Mallawa <[email protected]>---
fs/xfs/xfs_sysfs.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_sysfs.c +0
-0@@ -906,7 +906,7 @@ xfs_mount_sysfs_init("metadata", &mp-
Quoted 1 line
m_error_meta_kobj,
xfs_error_meta_init); if (error)fs/xfs/xfs_sysfs.c xfs_mount_sysfs_init( · line 909
Quoted 2 lines
fs/xfs/xfs_sysfs.c +1
-1- 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 them_error_kobj.
Quoted 6 lines
Quoted 2 lines
I am honestly not sure if
kobject_delwould 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?
Yup, you're right.
Quoted 3 lines
Thanks!
Quoted 4 lines · Wilfred Mallawa
The goto for failing to setup /error/metadata jumps to the wrong place in
xfs_mount_sysfs_init(). Fix it.
Applied to for-next, thanks!
[1/1] xfs: fix unwind handling during xfs_mount_sysfs_init()
commit: 7e31d6dd3419e27ca74b2f9844d5a014f05e814d
Best regards,
Signature · 1 line
Carlos Maiolino <[email protected]>