提交 5adc78d0 编写于 作者: M Mikulas Patocka 提交者: Alasdair G Kergon

dm log: introduce flush_failed variable

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

So we need to set all regions as not-in-sync and set the variable
"flush_failed" to prevent setting the in-sync bit in the future.

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

The variable will be set in following patches.
Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 20a34a8e
...@@ -210,6 +210,7 @@ struct log_c { ...@@ -210,6 +210,7 @@ struct log_c {
struct dm_target *ti; struct dm_target *ti;
int touched_dirtied; int touched_dirtied;
int touched_cleaned; int touched_cleaned;
int flush_failed;
uint32_t region_size; uint32_t region_size;
unsigned int region_count; unsigned int region_count;
region_t sync_count; region_t sync_count;
...@@ -394,6 +395,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, ...@@ -394,6 +395,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
lc->ti = ti; lc->ti = ti;
lc->touched_dirtied = 0; lc->touched_dirtied = 0;
lc->touched_cleaned = 0; lc->touched_cleaned = 0;
lc->flush_failed = 0;
lc->region_size = region_size; lc->region_size = region_size;
lc->region_count = region_count; lc->region_count = region_count;
lc->sync = sync; lc->sync = sync;
...@@ -706,7 +708,8 @@ static void core_mark_region(struct dm_dirty_log *log, region_t region) ...@@ -706,7 +708,8 @@ static void core_mark_region(struct dm_dirty_log *log, region_t region)
static void core_clear_region(struct dm_dirty_log *log, region_t region) static void core_clear_region(struct dm_dirty_log *log, region_t region)
{ {
struct log_c *lc = (struct log_c *) log->context; 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) static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册