Loading drivers/md/raid1.c +41 −58 Original line number Original line Diff line number Diff line Loading @@ -347,12 +347,9 @@ static void raid1_end_read_request(struct bio *bio) * oops, read error: * oops, read error: */ */ char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE]; printk_ratelimited( pr_err_ratelimited("md/raid1:%s: %s: rescheduling sector %llu\n", KERN_ERR "md/raid1:%s: %s: " "rescheduling sector %llu\n", mdname(conf->mddev), mdname(conf->mddev), bdevname(rdev->bdev, bdevname(rdev->bdev, b), b), (unsigned long long)r1_bio->sector); (unsigned long long)r1_bio->sector); set_bit(R1BIO_ReadError, &r1_bio->state); set_bit(R1BIO_ReadError, &r1_bio->state); reschedule_retry(r1_bio); reschedule_retry(r1_bio); Loading Loading @@ -1461,8 +1458,7 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev) set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_mask_bits(&mddev->flags, 0, set_mask_bits(&mddev->flags, 0, BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING)); BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING)); printk(KERN_ALERT pr_crit("md/raid1:%s: Disk failure on %s, disabling device.\n" "md/raid1:%s: Disk failure on %s, disabling device.\n" "md/raid1:%s: Operation continuing on %d devices.\n", "md/raid1:%s: Operation continuing on %d devices.\n", mdname(mddev), bdevname(rdev->bdev, b), mdname(mddev), bdevname(rdev->bdev, b), mdname(mddev), conf->raid_disks - mddev->degraded); mdname(mddev), conf->raid_disks - mddev->degraded); Loading @@ -1472,12 +1468,12 @@ static void print_conf(struct r1conf *conf) { { int i; int i; printk(KERN_DEBUG "RAID1 conf printout:\n"); pr_debug("RAID1 conf printout:\n"); if (!conf) { if (!conf) { printk(KERN_DEBUG "(!conf)\n"); pr_debug("(!conf)\n"); return; return; } } printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, conf->raid_disks); conf->raid_disks); rcu_read_lock(); rcu_read_lock(); Loading @@ -1485,7 +1481,7 @@ static void print_conf(struct r1conf *conf) char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE]; struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); if (rdev) if (rdev) printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", pr_debug(" disk %d, wo:%d, o:%d, dev:%s\n", i, !test_bit(In_sync, &rdev->flags), i, !test_bit(In_sync, &rdev->flags), !test_bit(Faulty, &rdev->flags), !test_bit(Faulty, &rdev->flags), bdevname(rdev->bdev,b)); bdevname(rdev->bdev,b)); Loading Loading @@ -1825,8 +1821,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) * work just disable and interrupt the recovery. * work just disable and interrupt the recovery. * Don't fail devices as that won't really help. * Don't fail devices as that won't really help. */ */ printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O read error" pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n", " for block %llu\n", mdname(mddev), mdname(mddev), bdevname(bio->bi_bdev, b), bdevname(bio->bi_bdev, b), (unsigned long long)r1_bio->sector); (unsigned long long)r1_bio->sector); Loading Loading @@ -2122,9 +2117,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, if (r1_sync_page_io(rdev, sect, s, if (r1_sync_page_io(rdev, sect, s, conf->tmppage, READ)) { conf->tmppage, READ)) { atomic_add(s, &rdev->corrected_errors); atomic_add(s, &rdev->corrected_errors); printk(KERN_INFO pr_info("md/raid1:%s: read error corrected (%d sectors at %llu on %s)\n", "md/raid1:%s: read error corrected " "(%d sectors at %llu on %s)\n", mdname(mddev), s, mdname(mddev), s, (unsigned long long)(sect + (unsigned long long)(sect + rdev->data_offset), rdev->data_offset), Loading Loading @@ -2317,8 +2310,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio) read_more: read_more: disk = read_balance(conf, r1_bio, &max_sectors); disk = read_balance(conf, r1_bio, &max_sectors); if (disk == -1) { if (disk == -1) { printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O" pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n", " read error for block %llu\n", mdname(mddev), b, (unsigned long long)r1_bio->sector); mdname(mddev), b, (unsigned long long)r1_bio->sector); raid_end_bio_io(r1_bio); raid_end_bio_io(r1_bio); } else { } else { Loading @@ -2330,9 +2322,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio) max_sectors); max_sectors); r1_bio->bios[r1_bio->read_disk] = bio; r1_bio->bios[r1_bio->read_disk] = bio; rdev = conf->mirrors[disk].rdev; rdev = conf->mirrors[disk].rdev; printk_ratelimited(KERN_ERR pr_info_ratelimited("md/raid1:%s: redirecting sector %llu to other mirror: %s\n", "md/raid1:%s: redirecting sector %llu" " to other mirror: %s\n", mdname(mddev), mdname(mddev), (unsigned long long)r1_bio->sector, (unsigned long long)r1_bio->sector, bdevname(rdev->bdev, b)); bdevname(rdev->bdev, b)); Loading Loading @@ -2875,12 +2865,8 @@ static struct r1conf *setup_conf(struct mddev *mddev) err = -ENOMEM; err = -ENOMEM; conf->thread = md_register_thread(raid1d, mddev, "raid1"); conf->thread = md_register_thread(raid1d, mddev, "raid1"); if (!conf->thread) { if (!conf->thread) printk(KERN_ERR "md/raid1:%s: couldn't allocate thread\n", mdname(mddev)); goto abort; goto abort; } return conf; return conf; Loading @@ -2905,12 +2891,12 @@ static int raid1_run(struct mddev *mddev) bool discard_supported = false; bool discard_supported = false; if (mddev->level != 1) { if (mddev->level != 1) { printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", pr_warn("md/raid1:%s: raid level not set to mirroring (%d)\n", mdname(mddev), mddev->level); mdname(mddev), mddev->level); return -EIO; return -EIO; } } if (mddev->reshape_position != MaxSector) { if (mddev->reshape_position != MaxSector) { printk(KERN_ERR "md/raid1:%s: reshape_position set but not supported\n", pr_warn("md/raid1:%s: reshape_position set but not supported\n", mdname(mddev)); mdname(mddev)); return -EIO; return -EIO; } } Loading Loading @@ -2950,11 +2936,9 @@ static int raid1_run(struct mddev *mddev) mddev->recovery_cp = MaxSector; mddev->recovery_cp = MaxSector; if (mddev->recovery_cp != MaxSector) if (mddev->recovery_cp != MaxSector) printk(KERN_NOTICE "md/raid1:%s: not clean" pr_info("md/raid1:%s: not clean -- starting background reconstruction\n", " -- starting background reconstruction\n", mdname(mddev)); mdname(mddev)); printk(KERN_INFO pr_info("md/raid1:%s: active with %d out of %d mirrors\n", "md/raid1:%s: active with %d out of %d mirrors\n", mdname(mddev), mddev->raid_disks - mddev->degraded, mdname(mddev), mddev->raid_disks - mddev->degraded, mddev->raid_disks); mddev->raid_disks); Loading Loading @@ -3107,8 +3091,7 @@ static int raid1_reshape(struct mddev *mddev) rdev->raid_disk = d2; rdev->raid_disk = d2; sysfs_unlink_rdev(mddev, rdev); sysfs_unlink_rdev(mddev, rdev); if (sysfs_link_rdev(mddev, rdev)) if (sysfs_link_rdev(mddev, rdev)) printk(KERN_WARNING pr_warn("md/raid1:%s: cannot register rd%d\n", "md/raid1:%s: cannot register rd%d\n", mdname(mddev), rdev->raid_disk); mdname(mddev), rdev->raid_disk); } } if (rdev) if (rdev) Loading Loading
drivers/md/raid1.c +41 −58 Original line number Original line Diff line number Diff line Loading @@ -347,12 +347,9 @@ static void raid1_end_read_request(struct bio *bio) * oops, read error: * oops, read error: */ */ char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE]; printk_ratelimited( pr_err_ratelimited("md/raid1:%s: %s: rescheduling sector %llu\n", KERN_ERR "md/raid1:%s: %s: " "rescheduling sector %llu\n", mdname(conf->mddev), mdname(conf->mddev), bdevname(rdev->bdev, bdevname(rdev->bdev, b), b), (unsigned long long)r1_bio->sector); (unsigned long long)r1_bio->sector); set_bit(R1BIO_ReadError, &r1_bio->state); set_bit(R1BIO_ReadError, &r1_bio->state); reschedule_retry(r1_bio); reschedule_retry(r1_bio); Loading Loading @@ -1461,8 +1458,7 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev) set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_mask_bits(&mddev->flags, 0, set_mask_bits(&mddev->flags, 0, BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING)); BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING)); printk(KERN_ALERT pr_crit("md/raid1:%s: Disk failure on %s, disabling device.\n" "md/raid1:%s: Disk failure on %s, disabling device.\n" "md/raid1:%s: Operation continuing on %d devices.\n", "md/raid1:%s: Operation continuing on %d devices.\n", mdname(mddev), bdevname(rdev->bdev, b), mdname(mddev), bdevname(rdev->bdev, b), mdname(mddev), conf->raid_disks - mddev->degraded); mdname(mddev), conf->raid_disks - mddev->degraded); Loading @@ -1472,12 +1468,12 @@ static void print_conf(struct r1conf *conf) { { int i; int i; printk(KERN_DEBUG "RAID1 conf printout:\n"); pr_debug("RAID1 conf printout:\n"); if (!conf) { if (!conf) { printk(KERN_DEBUG "(!conf)\n"); pr_debug("(!conf)\n"); return; return; } } printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, conf->raid_disks); conf->raid_disks); rcu_read_lock(); rcu_read_lock(); Loading @@ -1485,7 +1481,7 @@ static void print_conf(struct r1conf *conf) char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE]; struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); if (rdev) if (rdev) printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", pr_debug(" disk %d, wo:%d, o:%d, dev:%s\n", i, !test_bit(In_sync, &rdev->flags), i, !test_bit(In_sync, &rdev->flags), !test_bit(Faulty, &rdev->flags), !test_bit(Faulty, &rdev->flags), bdevname(rdev->bdev,b)); bdevname(rdev->bdev,b)); Loading Loading @@ -1825,8 +1821,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) * work just disable and interrupt the recovery. * work just disable and interrupt the recovery. * Don't fail devices as that won't really help. * Don't fail devices as that won't really help. */ */ printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O read error" pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n", " for block %llu\n", mdname(mddev), mdname(mddev), bdevname(bio->bi_bdev, b), bdevname(bio->bi_bdev, b), (unsigned long long)r1_bio->sector); (unsigned long long)r1_bio->sector); Loading Loading @@ -2122,9 +2117,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, if (r1_sync_page_io(rdev, sect, s, if (r1_sync_page_io(rdev, sect, s, conf->tmppage, READ)) { conf->tmppage, READ)) { atomic_add(s, &rdev->corrected_errors); atomic_add(s, &rdev->corrected_errors); printk(KERN_INFO pr_info("md/raid1:%s: read error corrected (%d sectors at %llu on %s)\n", "md/raid1:%s: read error corrected " "(%d sectors at %llu on %s)\n", mdname(mddev), s, mdname(mddev), s, (unsigned long long)(sect + (unsigned long long)(sect + rdev->data_offset), rdev->data_offset), Loading Loading @@ -2317,8 +2310,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio) read_more: read_more: disk = read_balance(conf, r1_bio, &max_sectors); disk = read_balance(conf, r1_bio, &max_sectors); if (disk == -1) { if (disk == -1) { printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O" pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n", " read error for block %llu\n", mdname(mddev), b, (unsigned long long)r1_bio->sector); mdname(mddev), b, (unsigned long long)r1_bio->sector); raid_end_bio_io(r1_bio); raid_end_bio_io(r1_bio); } else { } else { Loading @@ -2330,9 +2322,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio) max_sectors); max_sectors); r1_bio->bios[r1_bio->read_disk] = bio; r1_bio->bios[r1_bio->read_disk] = bio; rdev = conf->mirrors[disk].rdev; rdev = conf->mirrors[disk].rdev; printk_ratelimited(KERN_ERR pr_info_ratelimited("md/raid1:%s: redirecting sector %llu to other mirror: %s\n", "md/raid1:%s: redirecting sector %llu" " to other mirror: %s\n", mdname(mddev), mdname(mddev), (unsigned long long)r1_bio->sector, (unsigned long long)r1_bio->sector, bdevname(rdev->bdev, b)); bdevname(rdev->bdev, b)); Loading Loading @@ -2875,12 +2865,8 @@ static struct r1conf *setup_conf(struct mddev *mddev) err = -ENOMEM; err = -ENOMEM; conf->thread = md_register_thread(raid1d, mddev, "raid1"); conf->thread = md_register_thread(raid1d, mddev, "raid1"); if (!conf->thread) { if (!conf->thread) printk(KERN_ERR "md/raid1:%s: couldn't allocate thread\n", mdname(mddev)); goto abort; goto abort; } return conf; return conf; Loading @@ -2905,12 +2891,12 @@ static int raid1_run(struct mddev *mddev) bool discard_supported = false; bool discard_supported = false; if (mddev->level != 1) { if (mddev->level != 1) { printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", pr_warn("md/raid1:%s: raid level not set to mirroring (%d)\n", mdname(mddev), mddev->level); mdname(mddev), mddev->level); return -EIO; return -EIO; } } if (mddev->reshape_position != MaxSector) { if (mddev->reshape_position != MaxSector) { printk(KERN_ERR "md/raid1:%s: reshape_position set but not supported\n", pr_warn("md/raid1:%s: reshape_position set but not supported\n", mdname(mddev)); mdname(mddev)); return -EIO; return -EIO; } } Loading Loading @@ -2950,11 +2936,9 @@ static int raid1_run(struct mddev *mddev) mddev->recovery_cp = MaxSector; mddev->recovery_cp = MaxSector; if (mddev->recovery_cp != MaxSector) if (mddev->recovery_cp != MaxSector) printk(KERN_NOTICE "md/raid1:%s: not clean" pr_info("md/raid1:%s: not clean -- starting background reconstruction\n", " -- starting background reconstruction\n", mdname(mddev)); mdname(mddev)); printk(KERN_INFO pr_info("md/raid1:%s: active with %d out of %d mirrors\n", "md/raid1:%s: active with %d out of %d mirrors\n", mdname(mddev), mddev->raid_disks - mddev->degraded, mdname(mddev), mddev->raid_disks - mddev->degraded, mddev->raid_disks); mddev->raid_disks); Loading Loading @@ -3107,8 +3091,7 @@ static int raid1_reshape(struct mddev *mddev) rdev->raid_disk = d2; rdev->raid_disk = d2; sysfs_unlink_rdev(mddev, rdev); sysfs_unlink_rdev(mddev, rdev); if (sysfs_link_rdev(mddev, rdev)) if (sysfs_link_rdev(mddev, rdev)) printk(KERN_WARNING pr_warn("md/raid1:%s: cannot register rd%d\n", "md/raid1:%s: cannot register rd%d\n", mdname(mddev), rdev->raid_disk); mdname(mddev), rdev->raid_disk); } } if (rdev) if (rdev) Loading