]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch
diff --git a/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch
new file mode 100644 (file)
index 0000000..a909e14
--- /dev/null
@@ -0,0 +1,73 @@
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 20 Oct 2008 19:23:51 +0200
+Subject: 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>
+---
+ fs/ocfs2/file.c |   20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+Index: linux-2.6.27-ocfs2/fs/ocfs2/file.c
+===================================================================
+--- linux-2.6.27-ocfs2.orig/fs/ocfs2/file.c
++++ linux-2.6.27-ocfs2/fs/ocfs2/file.c
+@@ -247,8 +247,8 @@ int ocfs2_update_inode_atime(struct inod
+       mlog_entry_void();
+       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+-      if (handle == NULL) {
+-              ret = -ENOMEM;
++      if (IS_ERR(handle)) {
++              ret = PTR_ERR(handle);
+               mlog_errno(ret);
+               goto out;
+       }
+@@ -312,8 +312,8 @@ static int ocfs2_simple_size_update(stru
+       handle_t *handle = NULL;
+       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+-      if (handle == NULL) {
+-              ret = -ENOMEM;
++      if (IS_ERR(handle)) {
++              ret = PTR_ERR(handle);
+               mlog_errno(ret);
+               goto out;
+       }
+@@ -1055,8 +1055,8 @@ static int __ocfs2_write_remove_suid(str
+                  (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode);
+       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+-      if (handle == NULL) {
+-              ret = -ENOMEM;
++      if (IS_ERR(handle)) {
++              ret = PTR_ERR(handle);
+               mlog_errno(ret);
+               goto out;
+       }
+@@ -1259,8 +1259,8 @@ static int __ocfs2_remove_inode_range(st
+       }
+       handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
+-      if (handle == NULL) {
+-              ret = -ENOMEM;
++      if (IS_ERR(handle)) {
++              ret = PTR_ERR(handle);
+               mlog_errno(ret);
+               goto out;
+       }
+@@ -1352,8 +1352,8 @@ static int ocfs2_zero_partial_clusters(s
+               goto out;
+       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+-      if (handle == NULL) {
+-              ret = -ENOMEM;
++      if (IS_ERR(handle)) {
++              ret = PTR_ERR(handle);
+               mlog_errno(ret);
+               goto out;
+       }