diff mbox

[7/8] raid1 barriers

Message ID Pine.LNX.4.64.0904270751070.18227@hs20-bc2-1.build.redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Mikulas Patocka April 27, 2009, 11:51 a.m. UTC
Call the flush callback from the log.

If flush failed, we need to mark the whole log as dirty. Also, set variable
flush_failed, which prevents any bits ever being marked as free.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/md/dm-log.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

Index: linux-2.6.30-rc2-devel/drivers/md/dm-log.c
===================================================================
--- linux-2.6.30-rc2-devel.orig/drivers/md/dm-log.c	2009-04-27 12:48:34.000000000 +0200
+++ linux-2.6.30-rc2-devel/drivers/md/dm-log.c	2009-04-27 12:49:00.000000000 +0200
@@ -679,6 +679,20 @@  static int disk_flush(struct dm_dirty_lo
 	if (!lc->touched_cleaned && !lc->touched_dirtied)
 		return 0;
 
+	if (lc->touched_cleaned && flush) {
+		if (flush(cookie)) {
+			/*
+			 * At this point it is impossible to determine which
+			 * regions are clean and which are dirty. So mark all
+			 * of them dirty.
+			 */
+			int i;
+			lc->flush_failed = 1;
+			for (i = 0; i < lc->region_count; i++)
+				log_clear_bit(lc, lc->clean_bits, i);
+		}
+	}
+
 	r = rw_header(lc, WRITE);
 	if (r)
 		fail_log_device(lc);