Skip to contentSkip to conversation

xfs: fix unwind handling during xfs_mount_sysfs_init()

PATCH Applied Wilfred Mallawa 4 participants 6 messages Oct 26 – Nov 3 XFS filesystem

lore
Share & tools
lore
#0 lore raw

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.

Fixes a9a7b9e8686d ("xfs: add support for lazy direct read bounce buffering")
---
 fs/xfs/xfs_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_sysfs.c +1 -1
index e77917ac179d..4a6a8c92c3a1 100644
@@ -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
maintainer
#2 lore raw
In reply to Wilfred Mallawa
Quoted 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")
---
 fs/xfs/xfs_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_sysfs.c +0 -0
index e77917ac179d..4a6a8c92c3a1 100644

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 -0
 	return 0;
 
Signature · 1 line
2.56.0
#3 lore raw
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
in xfs_mount_sysfs_init(). Fix it.

Fixes a9a7b9e8686d ("xfs: add support for lazy direct read bounce

buffering")

---
 fs/xfs/xfs_sysfs.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_sysfs.c +0 -0
index e77917ac179d..4a6a8c92c3a1 100644
@@ -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 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!

maintainer Reviewed-by
#4 lore raw
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
in xfs_mount_sysfs_init(). Fix it.

Fixes a9a7b9e8686d ("xfs: add support for lazy direct read bounce

buffering")

---
 fs/xfs/xfs_sysfs.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_sysfs.c +0 -0
index e77917ac179d..4a6a8c92c3a1 100644
@@ -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 the m_error_kobj.

Quoted 6 lines
Quoted 2 lines

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?

Yup, you're right.

Quoted 3 lines

Thanks!

maintainer Applied
#5 lore raw
In reply to Wilfred Mallawa
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]>