[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH 6/8] raid1 barriers

Introduce "flush failed" variable. When flush before clearing a bit in the log
fails, we don't know anything about which which regions are in-sync and which

So we'll set all regions as not-in-sync, set the variable "flush_failed" that
will prevent setting the in-sync bit in the future.

A target reload is the only way how to get out of this situation.

The variable will be set in further patches.

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

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-24 11:17:50.000000000 +0200
+++ linux-2.6.30-rc2-devel/drivers/md/dm-log.c	2009-04-27 08:51:08.000000000 +0200
@@ -210,6 +210,7 @@ struct log_c {
 	struct dm_target *ti;
 	int touched_dirtied;
 	int touched_cleaned;
+	int flush_failed;
 	uint32_t region_size;
 	unsigned int region_count;
 	region_t sync_count;
@@ -393,6 +394,7 @@ static int create_log_context(struct dm_
 	lc->ti = ti;
 	lc->touched_dirtied = 0;
 	lc->touched_cleaned = 0;
+	lc->flush_failed = 0;
 	lc->region_size = region_size;
 	lc->region_count = region_count;
 	lc->sync = sync;
@@ -703,7 +719,8 @@ static void core_mark_region(struct dm_d
 static void core_clear_region(struct dm_dirty_log *log, region_t region)
 	struct log_c *lc = (struct log_c *) log->context;
-	log_set_bit(lc, lc->clean_bits, region);
+	if (likely(!lc->flush_failed))
+		log_set_bit(lc, lc->clean_bits, region);
 static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]