]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/buffer.c
block: submit_bh() inadvertently discards barrier flag on a sync write
[linux-2.6-omap-h63xx.git] / fs / buffer.c
index 38653e36e2252189dfad1cbf8f31f5473d2ccb00..ac78d4c19b3b3b27e812f13c0bd7669e962cea04 100644 (file)
@@ -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);
 
        /*