1 From: Jeff Mahoney <jeffm@suse.com>
2 Subject: ext4: cleanup sbi->s_kobj after quota initialization failure
4 If ext4_enable_quotas fails, it jumps to failed_mount7, which doesn't
5 tear down the kobj. If the user tries to mount the file system again,
6 they'll get big scary WARN_ONs from sysfs.
8 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
10 fs/ext4/super.c | 6 +++++-
11 1 file changed, 5 insertions(+), 1 deletion(-)
15 @@ -3794,7 +3794,7 @@ no_journal:
16 !(sb->s_flags & MS_RDONLY)) {
17 ret = ext4_enable_quotas(sb);
22 #endif /* CONFIG_QUOTA */
24 @@ -3813,6 +3813,10 @@ cantfind_ext4:
25 ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
29 + kobject_del(&sbi->s_kobj);
30 + kobject_put(&sbi->s_kobj);
31 + wait_for_completion(&sbi->s_kobj_unregister);
33 ext4_unregister_li_request(sb);