aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ioctl.c
diff options
context:
space:
mode:
authorjiangyiwen <jiangyiwen@huawei.com>2014-04-03 14:47:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 16:20:57 -0700
commit7dc3e83901b342ea7fe36262329c3784f2937361 (patch)
treee23d55a0c0bd98a0fce8e197e3e388bcdbaff655 /fs/ocfs2/ioctl.c
parentocfs2/o2net: o2net_listen_data_ready should do nothing if socket state is not TCP_LISTEN (diff)
downloadlinux-dev-7dc3e83901b342ea7fe36262329c3784f2937361.tar.xz
linux-dev-7dc3e83901b342ea7fe36262329c3784f2937361.zip
ocfs2: iput inode alloc when failed locally
In ocfs2_info_handle_freeinode() and ocfs2_test_inode_bit() func, after calls ocfs2_get_system_file_inode() to get inode ref, if calls ocfs2_info_scan_inode_alloc() or ocfs2_inode_lock() failed, we should iput inode alloc to avoid leaking the inode. Signed-off-by: jiangyiwen <jiangyiwen@huawei.com> Reviewed-by: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/ioctl.c')
-rw-r--r--fs/ocfs2/ioctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 8ca3c29accbf..490229f43731 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -413,11 +413,12 @@ int ocfs2_info_handle_freeinode(struct inode *inode,
}
status = ocfs2_info_scan_inode_alloc(osb, inode_alloc, blkno, oifi, i);
- if (status < 0)
- goto bail;
iput(inode_alloc);
inode_alloc = NULL;
+
+ if (status < 0)
+ goto bail;
}
o2info_set_request_filled(&oifi->ifi_req);