diff options
author | NeilBrown <neilb@suse.de> | 2006-07-10 07:44:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:17 -0400 |
commit | d69504325978c461b51b03cca49626026970307b (patch) | |
tree | 73ea1d68d5d3cca777cb6ea9828c5757b4cd6df8 /drivers/md/raid5.c | |
parent | 67463acb646904d76a8e237cc31eaa87872f30cc (diff) |
[PATCH] md: include sector number in messages about corrected read errors
This is generally useful, but particularly helps see if it is the same sector
that always needs correcting, or different ones.
[akpm@osdl.org: fix printk warnings]
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 56303ff31730..450066007160 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -523,6 +523,8 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, | |||
523 | raid5_conf_t *conf = sh->raid_conf; | 523 | raid5_conf_t *conf = sh->raid_conf; |
524 | int disks = sh->disks, i; | 524 | int disks = sh->disks, i; |
525 | int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); | 525 | int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); |
526 | char b[BDEVNAME_SIZE]; | ||
527 | mdk_rdev_t *rdev; | ||
526 | 528 | ||
527 | if (bi->bi_size) | 529 | if (bi->bi_size) |
528 | return 1; | 530 | return 1; |
@@ -570,25 +572,39 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, | |||
570 | set_bit(R5_UPTODATE, &sh->dev[i].flags); | 572 | set_bit(R5_UPTODATE, &sh->dev[i].flags); |
571 | #endif | 573 | #endif |
572 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { | 574 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { |
573 | printk(KERN_INFO "raid5: read error corrected!!\n"); | 575 | rdev = conf->disks[i].rdev; |
576 | printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", | ||
577 | mdname(conf->mddev), STRIPE_SECTORS, | ||
578 | (unsigned long long)sh->sector + rdev->data_offset, | ||
579 | bdevname(rdev->bdev, b)); | ||
574 | clear_bit(R5_ReadError, &sh->dev[i].flags); | 580 | clear_bit(R5_ReadError, &sh->dev[i].flags); |
575 | clear_bit(R5_ReWrite, &sh->dev[i].flags); | 581 | clear_bit(R5_ReWrite, &sh->dev[i].flags); |
576 | } | 582 | } |
577 | if (atomic_read(&conf->disks[i].rdev->read_errors)) | 583 | if (atomic_read(&conf->disks[i].rdev->read_errors)) |
578 | atomic_set(&conf->disks[i].rdev->read_errors, 0); | 584 | atomic_set(&conf->disks[i].rdev->read_errors, 0); |
579 | } else { | 585 | } else { |
586 | const char *bdn = bdevname(conf->disks[i].rdev->bdev, b); | ||
580 | int retry = 0; | 587 | int retry = 0; |
588 | rdev = conf->disks[i].rdev; | ||
589 | |||
581 | clear_bit(R5_UPTODATE, &sh->dev[i].flags); | 590 | clear_bit(R5_UPTODATE, &sh->dev[i].flags); |
582 | atomic_inc(&conf->disks[i].rdev->read_errors); | 591 | atomic_inc(&rdev->read_errors); |
583 | if (conf->mddev->degraded) | 592 | if (conf->mddev->degraded) |
584 | printk(KERN_WARNING "raid5: read error not correctable.\n"); | 593 | printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n", |
594 | mdname(conf->mddev), | ||
595 | (unsigned long long)sh->sector + rdev->data_offset, | ||
596 | bdn); | ||
585 | else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) | 597 | else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) |
586 | /* Oh, no!!! */ | 598 | /* Oh, no!!! */ |
587 | printk(KERN_WARNING "raid5: read error NOT corrected!!\n"); | 599 | printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n", |
588 | else if (atomic_read(&conf->disks[i].rdev->read_errors) | 600 | mdname(conf->mddev), |
601 | (unsigned long long)sh->sector + rdev->data_offset, | ||
602 | bdn); | ||
603 | else if (atomic_read(&rdev->read_errors) | ||
589 | > conf->max_nr_stripes) | 604 | > conf->max_nr_stripes) |
590 | printk(KERN_WARNING | 605 | printk(KERN_WARNING |
591 | "raid5: Too many read errors, failing device.\n"); | 606 | "raid5:%s: Too many read errors, failing device %s.\n", |
607 | mdname(conf->mddev), bdn); | ||
592 | else | 608 | else |
593 | retry = 1; | 609 | retry = 1; |
594 | if (retry) | 610 | if (retry) |
@@ -596,7 +612,7 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, | |||
596 | else { | 612 | else { |
597 | clear_bit(R5_ReadError, &sh->dev[i].flags); | 613 | clear_bit(R5_ReadError, &sh->dev[i].flags); |
598 | clear_bit(R5_ReWrite, &sh->dev[i].flags); | 614 | clear_bit(R5_ReWrite, &sh->dev[i].flags); |
599 | md_error(conf->mddev, conf->disks[i].rdev); | 615 | md_error(conf->mddev, rdev); |
600 | } | 616 | } |
601 | } | 617 | } |
602 | rdev_dec_pending(conf->disks[i].rdev, conf->mddev); | 618 | rdev_dec_pending(conf->disks[i].rdev, conf->mddev); |