aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-log.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-12-10 18:52:02 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 18:52:02 -0500
commit64b30c46e866bbff8a9e17883a18636adc358455 (patch)
treee79ecbec9170dad5704df2ceddda7b65b1e5d1f6 /drivers/md/dm-log.c
parentc0da3748b9a894b9f9b561ecc2d090a913988a0f (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>
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r--drivers/md/dm-log.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 315e36a96b6..7035582786f 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: