Commit 6be9d494 authored by Bernd Schubert's avatar Bernd Schubert Committed by Linus Torvalds

md: md: raid5 rate limit error printk

Last night we had scsi problems and a hardware raid unit was offlined
during heavy i/o.  While this happened we got for about 3 minutes a huge
number messages like these

Apr 12 03:36:07 pfs1n14 kernel: [197510.696595] raid5:md7: read error not correctable (sector 2993096568 on sdj2).

I guess the high error rate is responsible for not scheduling other events
- during this time the system was not pingable and in the end also other
devices run into scsi command timeouts causing problems on these unrelated
devices as well.
Signed-off-by: default avatarBernd Schubert <bernd-schubert@gmx.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6bcfd601
...@@ -94,6 +94,8 @@ ...@@ -94,6 +94,8 @@
#define __inline__ #define __inline__
#endif #endif
#define printk_rl(args...) ((void) (printk_ratelimit() && printk(args)))
#if !RAID6_USE_EMPTY_ZERO_PAGE #if !RAID6_USE_EMPTY_ZERO_PAGE
/* In .bss so it's zeroed */ /* In .bss so it's zeroed */
const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256))); const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
...@@ -1143,9 +1145,11 @@ static void raid5_end_read_request(struct bio * bi, int error) ...@@ -1143,9 +1145,11 @@ static void raid5_end_read_request(struct bio * bi, int error)
set_bit(R5_UPTODATE, &sh->dev[i].flags); set_bit(R5_UPTODATE, &sh->dev[i].flags);
if (test_bit(R5_ReadError, &sh->dev[i].flags)) { if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
rdev = conf->disks[i].rdev; rdev = conf->disks[i].rdev;
printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", printk_rl(KERN_INFO "raid5:%s: read error corrected"
" (%lu sectors at %llu on %s)\n",
mdname(conf->mddev), STRIPE_SECTORS, mdname(conf->mddev), STRIPE_SECTORS,
(unsigned long long)(sh->sector + rdev->data_offset), (unsigned long long)(sh->sector
+ rdev->data_offset),
bdevname(rdev->bdev, b)); bdevname(rdev->bdev, b));
clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags);
...@@ -1160,15 +1164,21 @@ static void raid5_end_read_request(struct bio * bi, int error) ...@@ -1160,15 +1164,21 @@ static void raid5_end_read_request(struct bio * bi, int error)
clear_bit(R5_UPTODATE, &sh->dev[i].flags); clear_bit(R5_UPTODATE, &sh->dev[i].flags);
atomic_inc(&rdev->read_errors); atomic_inc(&rdev->read_errors);
if (conf->mddev->degraded) if (conf->mddev->degraded)
printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n", printk_rl(KERN_WARNING
"raid5:%s: read error not correctable "
"(sector %llu on %s).\n",
mdname(conf->mddev), mdname(conf->mddev),
(unsigned long long)(sh->sector + rdev->data_offset), (unsigned long long)(sh->sector
+ rdev->data_offset),
bdn); bdn);
else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
/* Oh, no!!! */ /* Oh, no!!! */
printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n", printk_rl(KERN_WARNING
"raid5:%s: read error NOT corrected!! "
"(sector %llu on %s).\n",
mdname(conf->mddev), mdname(conf->mddev),
(unsigned long long)(sh->sector + rdev->data_offset), (unsigned long long)(sh->sector
+ rdev->data_offset),
bdn); bdn);
else if (atomic_read(&rdev->read_errors) else if (atomic_read(&rdev->read_errors)
> conf->max_nr_stripes) > conf->max_nr_stripes)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment