]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch
diff --git a/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch
new file mode 100644 (file)
index 0000000..0597e0d
--- /dev/null
@@ -0,0 +1,36 @@
+From: Joel Becker <joel.becker@oracle.com>
+Subject: ocfs2: Kill the last naked wait_on_buffer() for cached reads.
+Patch-mainline: 2.6.28
+
+ocfs2's cached buffer I/O goes through ocfs2_read_block(s)().  dir.c had
+a naked wait_on_buffer() to wait for some readahead, but it should
+use ocfs2_read_block() instead.
+
+Signed-off-by: Joel Becker <joel.becker@oracle.com>
+Signed-off-by: Mark Fasheh <mfasheh@suse.com>
+---
+ fs/ocfs2/dir.c |    7 +++----
+ 1 files changed, 3 insertions(+), 4 deletions(-)
+
+Index: linux-2.6.27/fs/ocfs2/dir.c
+===================================================================
+--- linux-2.6.27.orig/fs/ocfs2/dir.c
++++ linux-2.6.27/fs/ocfs2/dir.c
+@@ -302,14 +302,13 @@ restart:
+               }
+               if ((bh = bh_use[ra_ptr++]) == NULL)
+                       goto next;
+-              wait_on_buffer(bh);
+-              if (!buffer_uptodate(bh)) {
+-                      /* read error, skip block & hope for the best */
++              if (ocfs2_read_block(dir, block, &bh)) {
++                      /* read error, skip block & hope for the best.
++                       * ocfs2_read_block() has released the bh. */
+                       ocfs2_error(dir->i_sb, "reading directory %llu, "
+                                   "offset %lu\n",
+                                   (unsigned long long)OCFS2_I(dir)->ip_blkno,
+                                   block);
+-                      brelse(bh);
+                       goto next;
+               }
+               i = ocfs2_search_dirblock(bh, dir, name, namelen,