The patch titled md: include sector number in messages about corrected read errors has been added to the -mm tree. Its filename is md-include-sector-number-in-messages-about-corrected-read-errors.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: md: include sector number in messages about corrected read errors From: NeilBrown <neilb@xxxxxxx> This is generally useful, but particularly helps see if it is the same sector that always needs correcting, or different ones. Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/md/raid1.c | 3 +++ drivers/md/raid10.c | 4 ++++ drivers/md/raid5.c | 30 +++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff -puN drivers/md/raid10.c~md-include-sector-number-in-messages-about-corrected-read-errors drivers/md/raid10.c --- a/drivers/md/raid10.c~md-include-sector-number-in-messages-about-corrected-read-errors +++ a/drivers/md/raid10.c @@ -1492,6 +1492,10 @@ static void raid10d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0) /* Well, this device is dead */ md_error(mddev, rdev); + else + printk(KERN_INFO "raid10:%s: read error corrected (%d sectors at %llu on %s)\n", + mdname(mddev), s, sect+rdev->data_offset, bdevname(rdev->bdev, b)); + rdev_dec_pending(rdev, mddev); rcu_read_lock(); } diff -puN drivers/md/raid1.c~md-include-sector-number-in-messages-about-corrected-read-errors drivers/md/raid1.c --- a/drivers/md/raid1.c~md-include-sector-number-in-messages-about-corrected-read-errors +++ a/drivers/md/raid1.c @@ -1509,6 +1509,9 @@ static void raid1d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0) /* Well, this device is dead */ md_error(mddev, rdev); + else + printk(KERN_INFO "raid1:%s: read error corrected (%d sectors at %llu on %s)\n", + mdname(mddev), s, sect + rdev->data_offset, bdevname(rdev->bdev, b)); } } } else { diff -puN drivers/md/raid5.c~md-include-sector-number-in-messages-about-corrected-read-errors drivers/md/raid5.c --- a/drivers/md/raid5.c~md-include-sector-number-in-messages-about-corrected-read-errors +++ a/drivers/md/raid5.c @@ -524,6 +524,8 @@ static int raid5_end_read_request(struct raid5_conf_t *conf = sh->raid_conf; int disks = sh->disks, i; int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); + char b[BDEVNAME_SIZE]; + mdk_rdev_t *rdev; if (bi->bi_size) return 1; @@ -571,25 +573,39 @@ static int raid5_end_read_request(struct set_bit(R5_UPTODATE, &sh->dev[i].flags); #endif if (test_bit(R5_ReadError, &sh->dev[i].flags)) { - printk(KERN_INFO "raid5: read error corrected!!\n"); + rdev = conf->disks[i].rdev; + printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", + mdname(conf->mddev), STRIPE_SECTORS, + (unsigned long long)sh->sector + rdev->data_offset, + bdevname(rdev->bdev, b)); clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); } if (atomic_read(&conf->disks[i].rdev->read_errors)) atomic_set(&conf->disks[i].rdev->read_errors, 0); } else { + const char *bdn = bdevname(conf->disks[i].rdev->bdev, b); int retry = 0; + rdev = conf->disks[i].rdev; + clear_bit(R5_UPTODATE, &sh->dev[i].flags); - atomic_inc(&conf->disks[i].rdev->read_errors); + atomic_inc(&rdev->read_errors); if (conf->mddev->degraded) - printk(KERN_WARNING "raid5: read error not correctable.\n"); + printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n", + mdname(conf->mddev), + (unsigned long long)sh->sector + rdev->data_offset, + bdn); else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) /* Oh, no!!! */ - printk(KERN_WARNING "raid5: read error NOT corrected!!\n"); - else if (atomic_read(&conf->disks[i].rdev->read_errors) + printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n", + mdname(conf->mddev), + (unsigned long long)sh->sector + rdev->data_offset, + bdn); + else if (atomic_read(&rdev->read_errors) > conf->max_nr_stripes) printk(KERN_WARNING - "raid5: Too many read errors, failing device.\n"); + "raid5:%s: Too many read errors, failing device %s.\n", + mdname(conf->mddev), bdn); else retry = 1; if (retry) @@ -597,7 +613,7 @@ static int raid5_end_read_request(struct else { clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); - md_error(conf->mddev, conf->disks[i].rdev); + md_error(conf->mddev, rdev); } } rdev_dec_pending(conf->disks[i].rdev, conf->mddev); _ Patches currently in -mm which might be from neilb@xxxxxxx are origin.patch generic_file_buffered_write-deadlock-on-vectored-write.patch md-possible-fix-for-unplug-problem.patch md-set-desc_nr-correctly-for-version-1-superblocks.patch md-delay-starting-md-threads-until-array-is-completely-setup.patch md-fix-resync-speed-calculation-for-restarted-resyncs.patch md-fix-a-plug-unplug-race-in-raid5.patch md-fix-some-small-races-in-bitmap-plugging-in-raid5.patch md-fix-usage-of-wrong-variable-in-raid1.patch md-unify-usage-of-symbolic-names-for-perms.patch md-require-cap_sys_admin-for-re-configuring-md-devices-via-sysfs.patch md-fix-will-configure-message-when-interpreting-md=-kernel-parameter.patch md-include-sector-number-in-messages-about-corrected-read-errors.patch md-dm-reduce-stack-usage-with-stacked-block-devices.patch lockdep-annotate-sunrpc-code.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html