|
@@ -3521,17 +3521,16 @@ no_journal:
|
|
|
if (IS_ERR(root)) {
|
|
|
ext4_msg(sb, KERN_ERR, "get root inode failed");
|
|
|
ret = PTR_ERR(root);
|
|
|
+ root = NULL;
|
|
|
goto failed_mount4;
|
|
|
}
|
|
|
if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
|
|
|
- iput(root);
|
|
|
ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck");
|
|
|
goto failed_mount4;
|
|
|
}
|
|
|
sb->s_root = d_alloc_root(root);
|
|
|
if (!sb->s_root) {
|
|
|
ext4_msg(sb, KERN_ERR, "get root dentry failed");
|
|
|
- iput(root);
|
|
|
ret = -ENOMEM;
|
|
|
goto failed_mount4;
|
|
|
}
|
|
@@ -3647,6 +3646,8 @@ cantfind_ext4:
|
|
|
goto failed_mount;
|
|
|
|
|
|
failed_mount4:
|
|
|
+ iput(root);
|
|
|
+ sb->s_root = NULL;
|
|
|
ext4_msg(sb, KERN_ERR, "mount failed");
|
|
|
destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq);
|
|
|
failed_mount_wq:
|