aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-10-20 13:23:51 -0400
committerMark Fasheh <mfasheh@suse.com>2008-11-10 12:51:46 -0500
commitfa38e92cb34e27e60d0faf1035934eb9b44aa1d4 (patch)
treea7bbefddcf693735aa0dbdf3abca25b57268df1a /fs/ocfs2
parent8573f79d30077875e2b6e83849b5245bfbb08685 (diff)
ocfs2: Fix check of return value of ocfs2_start_trans()
On failure, ocfs2_start_trans() returns values like ERR_PTR(-ENOMEM). Thus checks for !handle are wrong. Fix them to use IS_ERR(). Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 7efe937a415f..3138a385fdbb 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -247,8 +247,8 @@ int ocfs2_update_inode_atime(struct inode *inode,
247 mlog_entry_void(); 247 mlog_entry_void();
248 248
249 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); 249 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
250 if (handle == NULL) { 250 if (IS_ERR(handle)) {
251 ret = -ENOMEM; 251 ret = PTR_ERR(handle);
252 mlog_errno(ret); 252 mlog_errno(ret);
253 goto out; 253 goto out;
254 } 254 }
@@ -312,8 +312,8 @@ static int ocfs2_simple_size_update(struct inode *inode,
312 handle_t *handle = NULL; 312 handle_t *handle = NULL;
313 313
314 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); 314 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
315 if (handle == NULL) { 315 if (IS_ERR(handle)) {
316 ret = -ENOMEM; 316 ret = PTR_ERR(handle);
317 mlog_errno(ret); 317 mlog_errno(ret);
318 goto out; 318 goto out;
319 } 319 }
@@ -1055,8 +1055,8 @@ static int __ocfs2_write_remove_suid(struct inode *inode,
1055 (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode); 1055 (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode);
1056 1056
1057 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); 1057 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
1058 if (handle == NULL) { 1058 if (IS_ERR(handle)) {
1059 ret = -ENOMEM; 1059 ret = PTR_ERR(handle);
1060 mlog_errno(ret); 1060 mlog_errno(ret);
1061 goto out; 1061 goto out;
1062 } 1062 }
@@ -1259,8 +1259,8 @@ static int __ocfs2_remove_inode_range(struct inode *inode,
1259 } 1259 }
1260 1260
1261 handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS); 1261 handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
1262 if (handle == NULL) { 1262 if (IS_ERR(handle)) {
1263 ret = -ENOMEM; 1263 ret = PTR_ERR(handle);
1264 mlog_errno(ret); 1264 mlog_errno(ret);
1265 goto out; 1265 goto out;
1266 } 1266 }
@@ -1352,8 +1352,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode,
1352 goto out; 1352 goto out;
1353 1353
1354 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); 1354 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
1355 if (handle == NULL) { 1355 if (IS_ERR(handle)) {
1356 ret = -ENOMEM; 1356 ret = PTR_ERR(handle);
1357 mlog_errno(ret); 1357 mlog_errno(ret);
1358 goto out; 1358 goto out;
1359 } 1359 }