diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 33c398785e53..bd6e86aa82aa 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3521,17 +3521,16 @@ no_journal: | |||
3521 | if (IS_ERR(root)) { | 3521 | if (IS_ERR(root)) { |
3522 | ext4_msg(sb, KERN_ERR, "get root inode failed"); | 3522 | ext4_msg(sb, KERN_ERR, "get root inode failed"); |
3523 | ret = PTR_ERR(root); | 3523 | ret = PTR_ERR(root); |
3524 | root = NULL; | ||
3524 | goto failed_mount4; | 3525 | goto failed_mount4; |
3525 | } | 3526 | } |
3526 | if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) { | 3527 | if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) { |
3527 | iput(root); | ||
3528 | ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck"); | 3528 | ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck"); |
3529 | goto failed_mount4; | 3529 | goto failed_mount4; |
3530 | } | 3530 | } |
3531 | sb->s_root = d_alloc_root(root); | 3531 | sb->s_root = d_alloc_root(root); |
3532 | if (!sb->s_root) { | 3532 | if (!sb->s_root) { |
3533 | ext4_msg(sb, KERN_ERR, "get root dentry failed"); | 3533 | ext4_msg(sb, KERN_ERR, "get root dentry failed"); |
3534 | iput(root); | ||
3535 | ret = -ENOMEM; | 3534 | ret = -ENOMEM; |
3536 | goto failed_mount4; | 3535 | goto failed_mount4; |
3537 | } | 3536 | } |
@@ -3647,6 +3646,8 @@ cantfind_ext4: | |||
3647 | goto failed_mount; | 3646 | goto failed_mount; |
3648 | 3647 | ||
3649 | failed_mount4: | 3648 | failed_mount4: |
3649 | iput(root); | ||
3650 | sb->s_root = NULL; | ||
3650 | ext4_msg(sb, KERN_ERR, "mount failed"); | 3651 | ext4_msg(sb, KERN_ERR, "mount failed"); |
3651 | destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq); | 3652 | destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq); |
3652 | failed_mount_wq: | 3653 | failed_mount_wq: |