Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux.git] / fs / ext4 / super.c
index 150840a4af38a73c20923d85cca33795c5613e74..ceebaf853beb74c7e139e63f46bf44975696566b 100644 (file)
@@ -3601,9 +3601,8 @@ no_journal:
                iput(root);
                goto failed_mount4;
        }
-       sb->s_root = d_alloc_root(root);
+       sb->s_root = d_make_root(root);
        if (!sb->s_root) {
-               iput(root);
                ext4_msg(sb, KERN_ERR, "get root dentry failed");
                ret = -ENOMEM;
                goto failed_mount4;
@@ -4909,6 +4908,9 @@ static int __init ext4_init_fs(void)
 {
        int i, err;
 
+       ext4_li_info = NULL;
+       mutex_init(&ext4_li_mtx);
+
        ext4_check_flag_values();
 
        for (i = 0; i < EXT4_WQ_HASH_SZ; i++) {
@@ -4947,8 +4949,6 @@ static int __init ext4_init_fs(void)
        if (err)
                goto out;
 
-       ext4_li_info = NULL;
-       mutex_init(&ext4_li_mtx);
        return 0;
 out:
        unregister_as_ext2();