]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch
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()
4
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().
7
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>
11 ---
12 fs/ocfs2/file.c | 20 ++++++++++----------
13 1 files changed, 10 insertions(+), 10 deletions(-)
14
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
20 mlog_entry_void();
21
22 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
23 - if (handle == NULL) {
24 - ret = -ENOMEM;
25 + if (IS_ERR(handle)) {
26 + ret = PTR_ERR(handle);
27 mlog_errno(ret);
28 goto out;
29 }
30 @@ -312,8 +312,8 @@ static int ocfs2_simple_size_update(stru
31 handle_t *handle = NULL;
32
33 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
34 - if (handle == NULL) {
35 - ret = -ENOMEM;
36 + if (IS_ERR(handle)) {
37 + ret = PTR_ERR(handle);
38 mlog_errno(ret);
39 goto out;
40 }
41 @@ -1055,8 +1055,8 @@ static int __ocfs2_write_remove_suid(str
42 (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode);
43
44 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
45 - if (handle == NULL) {
46 - ret = -ENOMEM;
47 + if (IS_ERR(handle)) {
48 + ret = PTR_ERR(handle);
49 mlog_errno(ret);
50 goto out;
51 }
52 @@ -1259,8 +1259,8 @@ static int __ocfs2_remove_inode_range(st
53 }
54
55 handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
56 - if (handle == NULL) {
57 - ret = -ENOMEM;
58 + if (IS_ERR(handle)) {
59 + ret = PTR_ERR(handle);
60 mlog_errno(ret);
61 goto out;
62 }
63 @@ -1352,8 +1352,8 @@ static int ocfs2_zero_partial_clusters(s
64 goto out;
65
66 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
67 - if (handle == NULL) {
68 - ret = -ENOMEM;
69 + if (IS_ERR(handle)) {
70 + ret = PTR_ERR(handle);
71 mlog_errno(ret);
72 goto out;
73 }