]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
... and the same failure exits cleanup for ocfs2
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 13 Feb 2012 02:46:49 +0000 (21:46 -0500)
committerXiaowei.Hu <xiaowei.hu@oracle.com>
Wed, 29 Aug 2012 06:10:01 +0000 (14:10 +0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit be0d93f0aa5682a24a2a9ec0dd26fffaad608cce)

Signed-off-by: Xiaowei.Hu <xiaowei.hu@oracle.com>
fs/ocfs2/super.c

index f13c1429a1c41e4f8433549ec18c146e8bbf9b80..9e666bf450a6720867ff1032ff5c2d108feb1798 100644 (file)
@@ -1161,12 +1161,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);
@@ -1175,6 +1175,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;
@@ -1227,9 +1228,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);