rpms/kernel/F-9 linux-2.6-block-submit_bh-discards-barrier-flag.patch, NONE, 1.1 kernel.spec, 1.751, 1.752

Chuck Ebbert cebbert at fedoraproject.org
Sun Aug 31 01:44:16 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11983

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-block-submit_bh-discards-barrier-flag.patch 
Log Message:
block: submit_bh() inadvertently discards barrier flag on a sync write

linux-2.6-block-submit_bh-discards-barrier-flag.patch:

--- NEW FILE linux-2.6-block-submit_bh-discards-barrier-flag.patch ---
From: Jens Axboe <jens.axboe at oracle.com>
Date: Fri, 22 Aug 2008 08:00:36 +0000 (+0200)
Subject: block: submit_bh() inadvertently discards barrier flag on a sync write
X-Git-Tag: v2.6.27-rc5~19^2~4
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=48fd4f93a00eac844678629f2f00518e146ed30d

block: submit_bh() inadvertently discards barrier flag on a sync write

Reported by Milan Broz <mbroz at redhat.com>, commit 18ce3751 inadvertently
made submit_bh() discard the barrier bit for a WRITE_SYNC request. Fix
that up.

Signed-off-by: Jens Axboe <jens.axboe at oracle.com>
---

diff --git a/fs/buffer.c b/fs/buffer.c
index 38653e3..ac78d4c 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2926,14 +2926,17 @@ int submit_bh(int rw, struct buffer_head * bh)
 	BUG_ON(!buffer_mapped(bh));
 	BUG_ON(!bh->b_end_io);
 
-	if (buffer_ordered(bh) && (rw == WRITE))
-		rw = WRITE_BARRIER;
+	/*
+	 * Mask in barrier bit for a write (could be either a WRITE or a
+	 * WRITE_SYNC
+	 */
+	if (buffer_ordered(bh) && (rw & WRITE))
+		rw |= WRITE_BARRIER;
 
 	/*
-	 * Only clear out a write error when rewriting, should this
-	 * include WRITE_SYNC as well?
+	 * Only clear out a write error when rewriting
 	 */
-	if (test_set_buffer_req(bh) && (rw == WRITE || rw == WRITE_BARRIER))
+	if (test_set_buffer_req(bh) && (rw & WRITE))
 		clear_buffer_write_io_error(bh);
 
 	/*


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/kernel.spec,v
retrieving revision 1.751
retrieving revision 1.752
diff -u -r1.751 -r1.752
--- kernel.spec	31 Aug 2008 01:28:44 -0000	1.751
+++ kernel.spec	31 Aug 2008 01:43:46 -0000	1.752
@@ -609,6 +609,7 @@
 
 Patch410: linux-2.6-bio-fix-__bio_copy_iov-handling-of-bv_len.patch
 Patch411: linux-2.6-bio-fix-bio_copy_kern-handling-of-bv_len.patch
+Patch412: linux-2.6-block-submit_bh-discards-barrier-flag.patch
 
 # filesystem patches
 Patch421: linux-2.6-squashfs.patch
@@ -1118,8 +1119,11 @@
 
 # block/bio
 #
+# bio patches queued for -stable
 ApplyPatch linux-2.6-bio-fix-__bio_copy_iov-handling-of-bv_len.patch
 ApplyPatch linux-2.6-bio-fix-bio_copy_kern-handling-of-bv_len.patch
+# don't discard barrier flags
+ApplyPatch linux-2.6-block-submit_bh-discards-barrier-flag.patch
 
 # Filesystem patches.
 # cifs
@@ -1809,6 +1813,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Sat Aug 30 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.3-25
+- block: submit_bh() inadvertently discards barrier flag on a sync write
+
 * Sat Aug 30 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.3-24
 - Fix cpuidle misbehavior. (#459214)
 




More information about the fedora-extras-commits mailing list