diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 02:37:37 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 02:37:37 +0100 |
commit | e4e11180dfa545233e5145919b75b7fac88638df (patch) | |
tree | bfdb18eee49aa55fd3d6170a422164e772736a1b /fs/ext4 | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next (diff) | |
parent | vfs: new helper - d_make_root() (diff) | |
download | linux-e4e11180dfa545233e5145919b75b7fac88638df.tar.xz linux-e4e11180dfa545233e5145919b75b7fac88638df.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
vfs: new helper - d_make_root()
dcache: use a dispose list in select_parent
ceph: d_alloc_root() may fail
ext4: fix failure exits
isofs: inode leak on mount failure
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 64e2529ae9bb..ed3ce82e2de4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3733,10 +3733,12 @@ no_journal: } if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) { ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck"); + iput(root); goto failed_mount4; } sb->s_root = d_alloc_root(root); if (!sb->s_root) { + iput(root); ext4_msg(sb, KERN_ERR, "get root dentry failed"); ret = -ENOMEM; goto failed_mount4; @@ -3773,7 +3775,7 @@ no_journal: if (err) { ext4_msg(sb, KERN_ERR, "failed to initialize system " "zone (%d)", err); - goto failed_mount4; + goto failed_mount4a; } ext4_ext_init(sb); @@ -3830,13 +3832,14 @@ cantfind_ext4: failed_mount7: ext4_unregister_li_request(sb); failed_mount6: - ext4_ext_release(sb); -failed_mount5: ext4_mb_release(sb); +failed_mount5: + ext4_ext_release(sb); ext4_release_system_zone(sb); -failed_mount4: - iput(root); +failed_mount4a: + dput(sb->s_root); sb->s_root = NULL; +failed_mount4: ext4_msg(sb, KERN_ERR, "mount failed"); destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq); failed_mount_wq: |