]> Pileus Git - ~andy/linux/commitdiff
ext4: release sysfs kobject when failing to enable quotas on mount
authorTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jan 2013 04:24:54 +0000 (23:24 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jan 2013 04:24:54 +0000 (23:24 -0500)
In addition, print the error returned from ext4_enable_quotas()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Cc: stable@vger.kernel.org
fs/ext4/super.c

index c014edd12648b9c1573d10a27cce82434581251f..3ac306064b285c88707ef97dfe3faebc62d95be6 100644 (file)
@@ -4009,7 +4009,7 @@ no_journal:
            !(sb->s_flags & MS_RDONLY)) {
                err = ext4_enable_quotas(sb);
                if (err)
-                       goto failed_mount7;
+                       goto failed_mount8;
        }
 #endif  /* CONFIG_QUOTA */
 
@@ -4036,6 +4036,10 @@ cantfind_ext4:
                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:
@@ -5006,9 +5010,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;
                        }
                }