public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: cleanup sbi->s_kobj after quota initialization failure
@ 2013-02-25 20:55 Jeff Mahoney
  2013-02-25 23:32 ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Mahoney @ 2013-02-25 20:55 UTC (permalink / raw)
  To: Jan Kara, Aditya Kali, Theodore Ts'o; +Cc: linux-ext4

If ext4_enable_quotas fails, it jumps to failed_mount7, which doesn't
tear down the kobj.

Cc: Aditya Kali <adityakali@google.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/ext4/super.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3794,7 +3794,7 @@ no_journal:
 	    !(sb->s_flags & MS_RDONLY)) {
 		err = ext4_enable_quotas(sb);
 		if (err)
-			goto failed_mount7;
+			goto failed_mount8;
 	}
 #endif  /* CONFIG_QUOTA */
 
@@ -3813,6 +3813,10 @@ cantfind_ext4:
 		ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
 	goto failed_mount;
 
+failed_mount8:
+	kobject_del(&sbi->s_kobj);
+	kobject_put(&sbi->s_kobj);
+	wait_for_completion(&sbi->s_kobj_unregister);
 failed_mount7:
 	ext4_unregister_li_request(sb);
 failed_mount6:

-- 
Jeff Mahoney
SUSE Labs

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

end of thread, other threads:[~2013-02-26  2:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 20:55 [PATCH] ext4: cleanup sbi->s_kobj after quota initialization failure Jeff Mahoney
2013-02-25 23:32 ` Jan Kara
2013-02-26  1:14   ` Aditya Kali
2013-02-26  2:53     ` Jeff Mahoney

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