Commit bcd7f174 authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Greg Kroah-Hartman

ext4: release sysfs kobject when failing to enable quotas on mount

commit 72ba7450 upstream.

In addition, print the error returned from ext4_enable_quotas()
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70d31ea8
......@@ -4008,7 +4008,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
!(sb->s_flags & MS_RDONLY)) {
err = ext4_enable_quotas(sb);
if (err)
goto failed_mount7;
goto failed_mount8;
}
#endif /* CONFIG_QUOTA */
......@@ -4035,6 +4035,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
goto failed_mount;
#ifdef CONFIG_QUOTA
failed_mount8:
kobject_del(&sbi->s_kobj);
#endif
failed_mount7:
ext4_unregister_li_request(sb);
failed_mount6:
......@@ -5005,9 +5009,9 @@ static int ext4_enable_quotas(struct super_block *sb)
DQUOT_USAGE_ENABLED);
if (err) {
ext4_warning(sb,
"Failed to enable quota (type=%d) "
"tracking. Please run e2fsck to fix.",
type);
"Failed to enable quota tracking "
"(type=%d, err=%d). Please run "
"e2fsck to fix.", type, err);
return err;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment