diff options
| -rw-r--r-- | drivers/md/raid10.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index a1d727610a49..e0742c439484 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
| @@ -285,7 +285,8 @@ static void raid10_end_read_request(struct bio *bio, int error) | |||
| 285 | */ | 285 | */ |
| 286 | char b[BDEVNAME_SIZE]; | 286 | char b[BDEVNAME_SIZE]; |
| 287 | if (printk_ratelimit()) | 287 | if (printk_ratelimit()) |
| 288 | printk(KERN_ERR "raid10: %s: rescheduling sector %llu\n", | 288 | printk(KERN_ERR "md/raid10:%s: %s: rescheduling sector %llu\n", |
| 289 | mdname(conf->mddev), | ||
| 289 | bdevname(conf->mirrors[dev].rdev->bdev,b), (unsigned long long)r10_bio->sector); | 290 | bdevname(conf->mirrors[dev].rdev->bdev,b), (unsigned long long)r10_bio->sector); |
| 290 | reschedule_retry(r10_bio); | 291 | reschedule_retry(r10_bio); |
| 291 | } | 292 | } |
| @@ -831,8 +832,8 @@ static int make_request(mddev_t *mddev, struct bio * bio) | |||
| 831 | bio_pair_release(bp); | 832 | bio_pair_release(bp); |
| 832 | return 0; | 833 | return 0; |
| 833 | bad_map: | 834 | bad_map: |
| 834 | printk("raid10_make_request bug: can't convert block across chunks" | 835 | printk("md/raid10:%s: make_request bug: can't convert block across chunks" |
| 835 | " or bigger than %dk %llu %d\n", chunk_sects/2, | 836 | " or bigger than %dk %llu %d\n", mdname(mddev), chunk_sects/2, |
| 836 | (unsigned long long)bio->bi_sector, bio->bi_size >> 10); | 837 | (unsigned long long)bio->bi_sector, bio->bi_size >> 10); |
| 837 | 838 | ||
| 838 | bio_io_error(bio); | 839 | bio_io_error(bio); |
| @@ -1031,9 +1032,10 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev) | |||
| 1031 | } | 1032 | } |
| 1032 | set_bit(Faulty, &rdev->flags); | 1033 | set_bit(Faulty, &rdev->flags); |
| 1033 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | 1034 | set_bit(MD_CHANGE_DEVS, &mddev->flags); |
| 1034 | printk(KERN_ALERT "raid10: Disk failure on %s, disabling device.\n" | 1035 | printk(KERN_ALERT "md/raid10:%s: Disk failure on %s, disabling device.\n" |
| 1035 | "raid10: Operation continuing on %d devices.\n", | 1036 | KERN_ALERT "md/raid10:%s: Operation continuing on %d devices.\n", |
| 1036 | bdevname(rdev->bdev,b), conf->raid_disks - mddev->degraded); | 1037 | mdname(mddev), bdevname(rdev->bdev, b), |
| 1038 | mdname(mddev), conf->raid_disks - mddev->degraded); | ||
| 1037 | } | 1039 | } |
| 1038 | 1040 | ||
| 1039 | static void print_conf(conf_t *conf) | 1041 | static void print_conf(conf_t *conf) |
| @@ -1041,19 +1043,19 @@ static void print_conf(conf_t *conf) | |||
| 1041 | int i; | 1043 | int i; |
| 1042 | mirror_info_t *tmp; | 1044 | mirror_info_t *tmp; |
| 1043 | 1045 | ||
| 1044 | printk("RAID10 conf printout:\n"); | 1046 | printk(KERN_DEBUG "RAID10 conf printout:\n"); |
| 1045 | if (!conf) { | 1047 | if (!conf) { |
| 1046 | printk("(!conf)\n"); | 1048 | printk(KERN_DEBUG "(!conf)\n"); |
| 1047 | return; | 1049 | return; |
| 1048 | } | 1050 | } |
| 1049 | printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, | 1051 | printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, |
| 1050 | conf->raid_disks); | 1052 | conf->raid_disks); |
| 1051 | 1053 | ||
| 1052 | for (i = 0; i < conf->raid_disks; i++) { | 1054 | for (i = 0; i < conf->raid_disks; i++) { |
| 1053 | char b[BDEVNAME_SIZE]; | 1055 | char b[BDEVNAME_SIZE]; |
| 1054 | tmp = conf->mirrors + i; | 1056 | tmp = conf->mirrors + i; |
| 1055 | if (tmp->rdev) | 1057 | if (tmp->rdev) |
| 1056 | printk(" disk %d, wo:%d, o:%d, dev:%s\n", | 1058 | printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", |
| 1057 | i, !test_bit(In_sync, &tmp->rdev->flags), | 1059 | i, !test_bit(In_sync, &tmp->rdev->flags), |
| 1058 | !test_bit(Faulty, &tmp->rdev->flags), | 1060 | !test_bit(Faulty, &tmp->rdev->flags), |
| 1059 | bdevname(tmp->rdev->bdev,b)); | 1061 | bdevname(tmp->rdev->bdev,b)); |
| @@ -1502,13 +1504,14 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) | |||
| 1502 | if (cur_read_error_count > max_read_errors) { | 1504 | if (cur_read_error_count > max_read_errors) { |
| 1503 | rcu_read_unlock(); | 1505 | rcu_read_unlock(); |
| 1504 | printk(KERN_NOTICE | 1506 | printk(KERN_NOTICE |
| 1505 | "raid10: %s: Raid device exceeded " | 1507 | "md/raid10:%s: %s: Raid device exceeded " |
| 1506 | "read_error threshold " | 1508 | "read_error threshold " |
| 1507 | "[cur %d:max %d]\n", | 1509 | "[cur %d:max %d]\n", |
| 1510 | mdname(mddev), | ||
| 1508 | b, cur_read_error_count, max_read_errors); | 1511 | b, cur_read_error_count, max_read_errors); |
| 1509 | printk(KERN_NOTICE | 1512 | printk(KERN_NOTICE |
| 1510 | "raid10: %s: Failing raid " | 1513 | "md/raid10:%s: %s: Failing raid " |
| 1511 | "device\n", b); | 1514 | "device\n", mdname(mddev), b); |
| 1512 | md_error(mddev, conf->mirrors[d].rdev); | 1515 | md_error(mddev, conf->mirrors[d].rdev); |
| 1513 | return; | 1516 | return; |
| 1514 | } | 1517 | } |
| @@ -1578,15 +1581,16 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) | |||
| 1578 | == 0) { | 1581 | == 0) { |
| 1579 | /* Well, this device is dead */ | 1582 | /* Well, this device is dead */ |
| 1580 | printk(KERN_NOTICE | 1583 | printk(KERN_NOTICE |
| 1581 | "raid10:%s: read correction " | 1584 | "md/raid10:%s: read correction " |
| 1582 | "write failed" | 1585 | "write failed" |
| 1583 | " (%d sectors at %llu on %s)\n", | 1586 | " (%d sectors at %llu on %s)\n", |
| 1584 | mdname(mddev), s, | 1587 | mdname(mddev), s, |
| 1585 | (unsigned long long)(sect+ | 1588 | (unsigned long long)(sect+ |
| 1586 | rdev->data_offset), | 1589 | rdev->data_offset), |
| 1587 | bdevname(rdev->bdev, b)); | 1590 | bdevname(rdev->bdev, b)); |
| 1588 | printk(KERN_NOTICE "raid10:%s: failing " | 1591 | printk(KERN_NOTICE "md/raid10:%s: %s: failing " |
| 1589 | "drive\n", | 1592 | "drive\n", |
| 1593 | mdname(mddev), | ||
| 1590 | bdevname(rdev->bdev, b)); | 1594 | bdevname(rdev->bdev, b)); |
| 1591 | md_error(mddev, rdev); | 1595 | md_error(mddev, rdev); |
| 1592 | } | 1596 | } |
| @@ -1614,20 +1618,21 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) | |||
| 1614 | READ) == 0) { | 1618 | READ) == 0) { |
| 1615 | /* Well, this device is dead */ | 1619 | /* Well, this device is dead */ |
| 1616 | printk(KERN_NOTICE | 1620 | printk(KERN_NOTICE |
| 1617 | "raid10:%s: unable to read back " | 1621 | "md/raid10:%s: unable to read back " |
| 1618 | "corrected sectors" | 1622 | "corrected sectors" |
| 1619 | " (%d sectors at %llu on %s)\n", | 1623 | " (%d sectors at %llu on %s)\n", |
| 1620 | mdname(mddev), s, | 1624 | mdname(mddev), s, |
| 1621 | (unsigned long long)(sect+ | 1625 | (unsigned long long)(sect+ |
| 1622 | rdev->data_offset), | 1626 | rdev->data_offset), |
| 1623 | bdevname(rdev->bdev, b)); | 1627 | bdevname(rdev->bdev, b)); |
| 1624 | printk(KERN_NOTICE "raid10:%s: failing drive\n", | 1628 | printk(KERN_NOTICE "md/raid10:%s: %s: failing drive\n", |
| 1629 | mdname(mddev), | ||
| 1625 | bdevname(rdev->bdev, b)); | 1630 | bdevname(rdev->bdev, b)); |
| 1626 | 1631 | ||
| 1627 | md_error(mddev, rdev); | 1632 | md_error(mddev, rdev); |
| 1628 | } else { | 1633 | } else { |
| 1629 | printk(KERN_INFO | 1634 | printk(KERN_INFO |
| 1630 | "raid10:%s: read error corrected" | 1635 | "md/raid10:%s: read error corrected" |
| 1631 | " (%d sectors at %llu on %s)\n", | 1636 | " (%d sectors at %llu on %s)\n", |
| 1632 | mdname(mddev), s, | 1637 | mdname(mddev), s, |
| 1633 | (unsigned long long)(sect+ | 1638 | (unsigned long long)(sect+ |
| @@ -1702,8 +1707,9 @@ static void raid10d(mddev_t *mddev) | |||
| 1702 | mddev->ro ? IO_BLOCKED : NULL; | 1707 | mddev->ro ? IO_BLOCKED : NULL; |
| 1703 | mirror = read_balance(conf, r10_bio); | 1708 | mirror = read_balance(conf, r10_bio); |
| 1704 | if (mirror == -1) { | 1709 | if (mirror == -1) { |
| 1705 | printk(KERN_ALERT "raid10: %s: unrecoverable I/O" | 1710 | printk(KERN_ALERT "md/raid10:%s: %s: unrecoverable I/O" |
| 1706 | " read error for block %llu\n", | 1711 | " read error for block %llu\n", |
| 1712 | mdname(mddev), | ||
| 1707 | bdevname(bio->bi_bdev,b), | 1713 | bdevname(bio->bi_bdev,b), |
| 1708 | (unsigned long long)r10_bio->sector); | 1714 | (unsigned long long)r10_bio->sector); |
| 1709 | raid_end_bio_io(r10_bio); | 1715 | raid_end_bio_io(r10_bio); |
| @@ -1713,8 +1719,9 @@ static void raid10d(mddev_t *mddev) | |||
| 1713 | bio_put(bio); | 1719 | bio_put(bio); |
| 1714 | rdev = conf->mirrors[mirror].rdev; | 1720 | rdev = conf->mirrors[mirror].rdev; |
| 1715 | if (printk_ratelimit()) | 1721 | if (printk_ratelimit()) |
| 1716 | printk(KERN_ERR "raid10: %s: redirecting sector %llu to" | 1722 | printk(KERN_ERR "md/raid10:%s: %s: redirecting sector %llu to" |
| 1717 | " another mirror\n", | 1723 | " another mirror\n", |
| 1724 | mdname(mddev), | ||
| 1718 | bdevname(rdev->bdev,b), | 1725 | bdevname(rdev->bdev,b), |
| 1719 | (unsigned long long)r10_bio->sector); | 1726 | (unsigned long long)r10_bio->sector); |
| 1720 | bio = bio_clone(r10_bio->master_bio, GFP_NOIO); | 1727 | bio = bio_clone(r10_bio->master_bio, GFP_NOIO); |
| @@ -1972,7 +1979,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
| 1972 | r10_bio = rb2; | 1979 | r10_bio = rb2; |
| 1973 | if (!test_and_set_bit(MD_RECOVERY_INTR, | 1980 | if (!test_and_set_bit(MD_RECOVERY_INTR, |
| 1974 | &mddev->recovery)) | 1981 | &mddev->recovery)) |
| 1975 | printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n", | 1982 | printk(KERN_INFO "md/raid10:%s: insufficient " |
| 1983 | "working devices for recovery.\n", | ||
| 1976 | mdname(mddev)); | 1984 | mdname(mddev)); |
| 1977 | break; | 1985 | break; |
| 1978 | } | 1986 | } |
| @@ -2154,8 +2162,9 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
| 2154 | 2162 | ||
| 2155 | if (mddev->chunk_sectors < (PAGE_SIZE >> 9) || | 2163 | if (mddev->chunk_sectors < (PAGE_SIZE >> 9) || |
| 2156 | !is_power_of_2(mddev->chunk_sectors)) { | 2164 | !is_power_of_2(mddev->chunk_sectors)) { |
| 2157 | printk(KERN_ERR "md/raid10: chunk size must be " | 2165 | printk(KERN_ERR "md/raid10:%s: chunk size must be " |
| 2158 | "at least PAGE_SIZE(%ld) and be a power of 2.\n", PAGE_SIZE); | 2166 | "at least PAGE_SIZE(%ld) and be a power of 2.\n", |
| 2167 | mdname(mddev), PAGE_SIZE); | ||
| 2159 | goto out; | 2168 | goto out; |
| 2160 | } | 2169 | } |
| 2161 | 2170 | ||
| @@ -2165,7 +2174,7 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
| 2165 | 2174 | ||
| 2166 | if ((nc*fc) <2 || (nc*fc) > mddev->raid_disks || | 2175 | if ((nc*fc) <2 || (nc*fc) > mddev->raid_disks || |
| 2167 | (mddev->layout >> 17)) { | 2176 | (mddev->layout >> 17)) { |
| 2168 | printk(KERN_ERR "raid10: %s: unsupported raid10 layout: 0x%8x\n", | 2177 | printk(KERN_ERR "md/raid10:%s: unsupported raid10 layout: 0x%8x\n", |
| 2169 | mdname(mddev), mddev->layout); | 2178 | mdname(mddev), mddev->layout); |
| 2170 | goto out; | 2179 | goto out; |
| 2171 | } | 2180 | } |
| @@ -2236,7 +2245,7 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
| 2236 | return conf; | 2245 | return conf; |
| 2237 | 2246 | ||
| 2238 | out: | 2247 | out: |
| 2239 | printk(KERN_ERR "raid10: couldn't allocate memory for %s\n", | 2248 | printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n", |
| 2240 | mdname(mddev)); | 2249 | mdname(mddev)); |
| 2241 | if (conf) { | 2250 | if (conf) { |
| 2242 | if (conf->r10bio_pool) | 2251 | if (conf->r10bio_pool) |
| @@ -2314,7 +2323,7 @@ static int run(mddev_t *mddev) | |||
| 2314 | } | 2323 | } |
| 2315 | /* need to check that every block has at least one working mirror */ | 2324 | /* need to check that every block has at least one working mirror */ |
| 2316 | if (!enough(conf)) { | 2325 | if (!enough(conf)) { |
| 2317 | printk(KERN_ERR "raid10: not enough operational mirrors for %s\n", | 2326 | printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n", |
| 2318 | mdname(mddev)); | 2327 | mdname(mddev)); |
| 2319 | goto out_free_conf; | 2328 | goto out_free_conf; |
| 2320 | } | 2329 | } |
| @@ -2334,11 +2343,11 @@ static int run(mddev_t *mddev) | |||
| 2334 | } | 2343 | } |
| 2335 | 2344 | ||
| 2336 | if (mddev->recovery_cp != MaxSector) | 2345 | if (mddev->recovery_cp != MaxSector) |
| 2337 | printk(KERN_NOTICE "raid10: %s is not clean" | 2346 | printk(KERN_NOTICE "md/raid10:%s: not clean" |
| 2338 | " -- starting background reconstruction\n", | 2347 | " -- starting background reconstruction\n", |
| 2339 | mdname(mddev)); | 2348 | mdname(mddev)); |
| 2340 | printk(KERN_INFO | 2349 | printk(KERN_INFO |
| 2341 | "raid10: raid set %s active with %d out of %d devices\n", | 2350 | "md/raid10:%s: active with %d out of %d devices\n", |
| 2342 | mdname(mddev), conf->raid_disks - mddev->degraded, | 2351 | mdname(mddev), conf->raid_disks - mddev->degraded, |
| 2343 | conf->raid_disks); | 2352 | conf->raid_disks); |
| 2344 | /* | 2353 | /* |
| @@ -2420,7 +2429,8 @@ static void *raid10_takeover_raid0(mddev_t *mddev) | |||
| 2420 | conf_t *conf; | 2429 | conf_t *conf; |
| 2421 | 2430 | ||
| 2422 | if (mddev->degraded > 0) { | 2431 | if (mddev->degraded > 0) { |
| 2423 | printk(KERN_ERR "error: degraded raid0!\n"); | 2432 | printk(KERN_ERR "md/raid10:%s: Error: degraded raid0!\n", |
| 2433 | mdname(mddev)); | ||
| 2424 | return ERR_PTR(-EINVAL); | 2434 | return ERR_PTR(-EINVAL); |
| 2425 | } | 2435 | } |
| 2426 | 2436 | ||
| @@ -2458,7 +2468,9 @@ static void *raid10_takeover(mddev_t *mddev) | |||
| 2458 | /* for raid0 takeover only one zone is supported */ | 2468 | /* for raid0 takeover only one zone is supported */ |
| 2459 | raid0_priv = mddev->private; | 2469 | raid0_priv = mddev->private; |
| 2460 | if (raid0_priv->nr_strip_zones > 1) { | 2470 | if (raid0_priv->nr_strip_zones > 1) { |
| 2461 | printk(KERN_ERR "md: cannot takeover raid 0 with more than one zone.\n"); | 2471 | printk(KERN_ERR "md/raid10:%s: cannot takeover raid 0" |
| 2472 | " with more than one zone.\n", | ||
| 2473 | mdname(mddev)); | ||
| 2462 | return ERR_PTR(-EINVAL); | 2474 | return ERR_PTR(-EINVAL); |
| 2463 | } | 2475 | } |
| 2464 | return raid10_takeover_raid0(mddev); | 2476 | return raid10_takeover_raid0(mddev); |
