1 From: Jan Kara <jack@suse.cz>
2 Date: Mon, 20 Oct 2008 19:23:51 +0200
3 Subject: ocfs2: Fix check of return value of ocfs2_start_trans()
5 On failure, ocfs2_start_trans() returns values like ERR_PTR(-ENOMEM).
6 Thus checks for !handle are wrong. Fix them to use IS_ERR().
8 Signed-off-by: Jan Kara <jack@suse.cz>
9 Signed-off-by: Joel Becker <joel.becker@oracle.com>
10 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12 fs/ocfs2/file.c | 20 ++++++++++----------
13 1 files changed, 10 insertions(+), 10 deletions(-)
15 Index: linux-2.6.27-ocfs2/fs/ocfs2/file.c
16 ===================================================================
17 --- linux-2.6.27-ocfs2.orig/fs/ocfs2/file.c
18 +++ linux-2.6.27-ocfs2/fs/ocfs2/file.c
19 @@ -247,8 +247,8 @@ int ocfs2_update_inode_atime(struct inod
22 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
23 - if (handle == NULL) {
25 + if (IS_ERR(handle)) {
26 + ret = PTR_ERR(handle);
30 @@ -312,8 +312,8 @@ static int ocfs2_simple_size_update(stru
31 handle_t *handle = NULL;
33 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
34 - if (handle == NULL) {
36 + if (IS_ERR(handle)) {
37 + ret = PTR_ERR(handle);
41 @@ -1055,8 +1055,8 @@ static int __ocfs2_write_remove_suid(str
42 (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode);
44 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
45 - if (handle == NULL) {
47 + if (IS_ERR(handle)) {
48 + ret = PTR_ERR(handle);
52 @@ -1259,8 +1259,8 @@ static int __ocfs2_remove_inode_range(st
55 handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
56 - if (handle == NULL) {
58 + if (IS_ERR(handle)) {
59 + ret = PTR_ERR(handle);
63 @@ -1352,8 +1352,8 @@ static int ocfs2_zero_partial_clusters(s
66 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
67 - if (handle == NULL) {
69 + if (IS_ERR(handle)) {
70 + ret = PTR_ERR(handle);