diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-12-10 18:52:02 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-12-10 18:52:02 -0500 |
commit | 64b30c46e866bbff8a9e17883a18636adc358455 (patch) | |
tree | e79ecbec9170dad5704df2ceddda7b65b1e5d1f6 | |
parent | c0da3748b9a894b9f9b561ecc2d090a913988a0f (diff) |
dm raid1: report flush errors separately in status
Report flush errors as 'F' instead of 'D' for log and mirror devices.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r-- | drivers/md/dm-log.c | 16 | ||||
-rw-r--r-- | drivers/md/dm-raid1.c | 6 |
2 files changed, 16 insertions, 6 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 315e36a96b6f..7035582786fb 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -237,6 +237,7 @@ struct log_c { | |||
237 | * Disk log fields | 237 | * Disk log fields |
238 | */ | 238 | */ |
239 | int log_dev_failed; | 239 | int log_dev_failed; |
240 | int log_dev_flush_failed; | ||
240 | struct dm_dev *log_dev; | 241 | struct dm_dev *log_dev; |
241 | struct log_header header; | 242 | struct log_header header; |
242 | 243 | ||
@@ -425,6 +426,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
425 | } else { | 426 | } else { |
426 | lc->log_dev = dev; | 427 | lc->log_dev = dev; |
427 | lc->log_dev_failed = 0; | 428 | lc->log_dev_failed = 0; |
429 | lc->log_dev_flush_failed = 0; | ||
428 | lc->header_location.bdev = lc->log_dev->bdev; | 430 | lc->header_location.bdev = lc->log_dev->bdev; |
429 | lc->header_location.sector = 0; | 431 | lc->header_location.sector = 0; |
430 | 432 | ||
@@ -633,8 +635,11 @@ static int disk_resume(struct dm_dirty_log *log) | |||
633 | 635 | ||
634 | /* write the new header */ | 636 | /* write the new header */ |
635 | r = rw_header(lc, WRITE); | 637 | r = rw_header(lc, WRITE); |
636 | if (!r) | 638 | if (!r) { |
637 | r = flush_header(lc); | 639 | r = flush_header(lc); |
640 | if (r) | ||
641 | lc->log_dev_flush_failed = 1; | ||
642 | } | ||
638 | if (r) { | 643 | if (r) { |
639 | DMWARN("%s: Failed to write header on dirty region log device", | 644 | DMWARN("%s: Failed to write header on dirty region log device", |
640 | lc->log_dev->name); | 645 | lc->log_dev->name); |
@@ -703,9 +708,10 @@ static int disk_flush(struct dm_dirty_log *log) | |||
703 | else { | 708 | else { |
704 | if (lc->touched_dirtied) { | 709 | if (lc->touched_dirtied) { |
705 | r = flush_header(lc); | 710 | r = flush_header(lc); |
706 | if (r) | 711 | if (r) { |
712 | lc->log_dev_flush_failed = 1; | ||
707 | fail_log_device(lc); | 713 | fail_log_device(lc); |
708 | else | 714 | } else |
709 | lc->touched_dirtied = 0; | 715 | lc->touched_dirtied = 0; |
710 | } | 716 | } |
711 | lc->touched_cleaned = 0; | 717 | lc->touched_cleaned = 0; |
@@ -805,7 +811,9 @@ static int disk_status(struct dm_dirty_log *log, status_type_t status, | |||
805 | switch(status) { | 811 | switch(status) { |
806 | case STATUSTYPE_INFO: | 812 | case STATUSTYPE_INFO: |
807 | DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name, | 813 | DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name, |
808 | lc->log_dev_failed ? 'D' : 'A'); | 814 | lc->log_dev_flush_failed ? 'F' : |
815 | lc->log_dev_failed ? 'D' : | ||
816 | 'A'); | ||
809 | break; | 817 | break; |
810 | 818 | ||
811 | case STATUSTYPE_TABLE: | 819 | case STATUSTYPE_TABLE: |
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 751660b0c574..85c8704c67bb 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -35,6 +35,7 @@ static DECLARE_WAIT_QUEUE_HEAD(_kmirrord_recovery_stopped); | |||
35 | *---------------------------------------------------------------*/ | 35 | *---------------------------------------------------------------*/ |
36 | enum dm_raid1_error { | 36 | enum dm_raid1_error { |
37 | DM_RAID1_WRITE_ERROR, | 37 | DM_RAID1_WRITE_ERROR, |
38 | DM_RAID1_FLUSH_ERROR, | ||
38 | DM_RAID1_SYNC_ERROR, | 39 | DM_RAID1_SYNC_ERROR, |
39 | DM_RAID1_READ_ERROR | 40 | DM_RAID1_READ_ERROR |
40 | }; | 41 | }; |
@@ -264,7 +265,7 @@ static int mirror_flush(struct dm_target *ti) | |||
264 | for (i = 0; i < ms->nr_mirrors; i++) | 265 | for (i = 0; i < ms->nr_mirrors; i++) |
265 | if (test_bit(i, &error_bits)) | 266 | if (test_bit(i, &error_bits)) |
266 | fail_mirror(ms->mirror + i, | 267 | fail_mirror(ms->mirror + i, |
267 | DM_RAID1_WRITE_ERROR); | 268 | DM_RAID1_FLUSH_ERROR); |
268 | return -EIO; | 269 | return -EIO; |
269 | } | 270 | } |
270 | 271 | ||
@@ -1288,7 +1289,8 @@ static char device_status_char(struct mirror *m) | |||
1288 | if (!atomic_read(&(m->error_count))) | 1289 | if (!atomic_read(&(m->error_count))) |
1289 | return 'A'; | 1290 | return 'A'; |
1290 | 1291 | ||
1291 | return (test_bit(DM_RAID1_WRITE_ERROR, &(m->error_type))) ? 'D' : | 1292 | return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' : |
1293 | (test_bit(DM_RAID1_WRITE_ERROR, &(m->error_type))) ? 'D' : | ||
1292 | (test_bit(DM_RAID1_SYNC_ERROR, &(m->error_type))) ? 'S' : | 1294 | (test_bit(DM_RAID1_SYNC_ERROR, &(m->error_type))) ? 'S' : |
1293 | (test_bit(DM_RAID1_READ_ERROR, &(m->error_type))) ? 'R' : 'U'; | 1295 | (test_bit(DM_RAID1_READ_ERROR, &(m->error_type))) ? 'R' : 'U'; |
1294 | } | 1296 | } |