summaryrefslogtreecommitdiff
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-02-12 21:46:49 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:34 -0400
commitbe0d93f0aa5682a24a2a9ec0dd26fffaad608cce (patch)
treefc35e184e39ffe630dfa62e881cb8dbd5d6db22c /fs/ocfs2
parentf56b0fbc6477e50303a503ee1453ed94e20f154a (diff)
... and the same failure exits cleanup for ocfs2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/super.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 604e12c4e97..2b1184f7097 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1154,12 +1154,12 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
}
status = ocfs2_mount_volume(sb);
- if (osb->root_inode)
- inode = igrab(osb->root_inode);
-
if (status < 0)
goto read_super_error;
+ if (osb->root_inode)
+ inode = igrab(osb->root_inode);
+
if (!inode) {
status = -EIO;
mlog_errno(status);
@@ -1168,6 +1168,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
root = d_alloc_root(inode);
if (!root) {
+ iput(inode);
status = -ENOMEM;
mlog_errno(status);
goto read_super_error;
@@ -1220,9 +1221,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
read_super_error:
brelse(bh);
- if (inode)
- iput(inode);
-
if (osb) {
atomic_set(&osb->vol_state, VOLUME_DISABLED);
wake_up(&osb->osb_mount_event);