diff options
author | NeilBrown <neilb@suse.de> | 2010-05-03 00:30:35 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-05-18 01:27:59 -0400 |
commit | 9dd1e2faf72f79a2af9dcbd059473c06648726c2 (patch) | |
tree | a3b400d49671930f6d6ff0b9d5890e598af7a94f /drivers/md | |
parent | 0c55e02259115c151e4835dd417cf41467bb02e2 (diff) |
md/raid1: improve printk messages
Make sure the array name is included in a uniform way in all printk
messages.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index cb2da87ad593..1db02c4955a9 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -296,7 +296,8 @@ static void raid1_end_read_request(struct bio *bio, int error) | |||
296 | */ | 296 | */ |
297 | char b[BDEVNAME_SIZE]; | 297 | char b[BDEVNAME_SIZE]; |
298 | if (printk_ratelimit()) | 298 | if (printk_ratelimit()) |
299 | printk(KERN_ERR "raid1: %s: rescheduling sector %llu\n", | 299 | printk(KERN_ERR "md/raid1:%s: %s: rescheduling sector %llu\n", |
300 | mdname(conf->mddev), | ||
300 | bdevname(conf->mirrors[mirror].rdev->bdev,b), (unsigned long long)r1_bio->sector); | 301 | bdevname(conf->mirrors[mirror].rdev->bdev,b), (unsigned long long)r1_bio->sector); |
301 | reschedule_retry(r1_bio); | 302 | reschedule_retry(r1_bio); |
302 | } | 303 | } |
@@ -1075,21 +1076,22 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1075 | } else | 1076 | } else |
1076 | set_bit(Faulty, &rdev->flags); | 1077 | set_bit(Faulty, &rdev->flags); |
1077 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | 1078 | set_bit(MD_CHANGE_DEVS, &mddev->flags); |
1078 | printk(KERN_ALERT "raid1: Disk failure on %s, disabling device.\n" | 1079 | printk(KERN_ALERT "md/raid1:%s: Disk failure on %s, disabling device.\n" |
1079 | "raid1: Operation continuing on %d devices.\n", | 1080 | KERN_ALERT "md/raid1:%s: Operation continuing on %d devices.\n", |
1080 | bdevname(rdev->bdev,b), conf->raid_disks - mddev->degraded); | 1081 | mdname(mddev), bdevname(rdev->bdev, b), |
1082 | mdname(mddev), conf->raid_disks - mddev->degraded); | ||
1081 | } | 1083 | } |
1082 | 1084 | ||
1083 | static void print_conf(conf_t *conf) | 1085 | static void print_conf(conf_t *conf) |
1084 | { | 1086 | { |
1085 | int i; | 1087 | int i; |
1086 | 1088 | ||
1087 | printk("RAID1 conf printout:\n"); | 1089 | printk(KERN_DEBUG "RAID1 conf printout:\n"); |
1088 | if (!conf) { | 1090 | if (!conf) { |
1089 | printk("(!conf)\n"); | 1091 | printk(KERN_DEBUG "(!conf)\n"); |
1090 | return; | 1092 | return; |
1091 | } | 1093 | } |
1092 | printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, | 1094 | printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, |
1093 | conf->raid_disks); | 1095 | conf->raid_disks); |
1094 | 1096 | ||
1095 | rcu_read_lock(); | 1097 | rcu_read_lock(); |
@@ -1097,7 +1099,7 @@ static void print_conf(conf_t *conf) | |||
1097 | char b[BDEVNAME_SIZE]; | 1099 | char b[BDEVNAME_SIZE]; |
1098 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 1100 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); |
1099 | if (rdev) | 1101 | if (rdev) |
1100 | printk(" disk %d, wo:%d, o:%d, dev:%s\n", | 1102 | printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", |
1101 | i, !test_bit(In_sync, &rdev->flags), | 1103 | i, !test_bit(In_sync, &rdev->flags), |
1102 | !test_bit(Faulty, &rdev->flags), | 1104 | !test_bit(Faulty, &rdev->flags), |
1103 | bdevname(rdev->bdev,b)); | 1105 | bdevname(rdev->bdev,b)); |
@@ -1458,9 +1460,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) | |||
1458 | char b[BDEVNAME_SIZE]; | 1460 | char b[BDEVNAME_SIZE]; |
1459 | /* Cannot read from anywhere, array is toast */ | 1461 | /* Cannot read from anywhere, array is toast */ |
1460 | md_error(mddev, conf->mirrors[r1_bio->read_disk].rdev); | 1462 | md_error(mddev, conf->mirrors[r1_bio->read_disk].rdev); |
1461 | printk(KERN_ALERT "raid1: %s: unrecoverable I/O read error" | 1463 | printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O read error" |
1462 | " for block %llu\n", | 1464 | " for block %llu\n", |
1463 | bdevname(bio->bi_bdev,b), | 1465 | mdname(mddev), |
1466 | bdevname(bio->bi_bdev, b), | ||
1464 | (unsigned long long)r1_bio->sector); | 1467 | (unsigned long long)r1_bio->sector); |
1465 | md_done_sync(mddev, r1_bio->sectors, 0); | 1468 | md_done_sync(mddev, r1_bio->sectors, 0); |
1466 | put_buf(r1_bio); | 1469 | put_buf(r1_bio); |
@@ -1582,7 +1585,7 @@ static void fix_read_error(conf_t *conf, int read_disk, | |||
1582 | else { | 1585 | else { |
1583 | atomic_add(s, &rdev->corrected_errors); | 1586 | atomic_add(s, &rdev->corrected_errors); |
1584 | printk(KERN_INFO | 1587 | printk(KERN_INFO |
1585 | "raid1:%s: read error corrected " | 1588 | "md/raid1:%s: read error corrected " |
1586 | "(%d sectors at %llu on %s)\n", | 1589 | "(%d sectors at %llu on %s)\n", |
1587 | mdname(mddev), s, | 1590 | mdname(mddev), s, |
1588 | (unsigned long long)(sect + | 1591 | (unsigned long long)(sect + |
@@ -1687,8 +1690,9 @@ static void raid1d(mddev_t *mddev) | |||
1687 | 1690 | ||
1688 | bio = r1_bio->bios[r1_bio->read_disk]; | 1691 | bio = r1_bio->bios[r1_bio->read_disk]; |
1689 | if ((disk=read_balance(conf, r1_bio)) == -1) { | 1692 | if ((disk=read_balance(conf, r1_bio)) == -1) { |
1690 | printk(KERN_ALERT "raid1: %s: unrecoverable I/O" | 1693 | printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O" |
1691 | " read error for block %llu\n", | 1694 | " read error for block %llu\n", |
1695 | mdname(mddev), | ||
1692 | bdevname(bio->bi_bdev,b), | 1696 | bdevname(bio->bi_bdev,b), |
1693 | (unsigned long long)r1_bio->sector); | 1697 | (unsigned long long)r1_bio->sector); |
1694 | raid_end_bio_io(r1_bio); | 1698 | raid_end_bio_io(r1_bio); |
@@ -1702,8 +1706,9 @@ static void raid1d(mddev_t *mddev) | |||
1702 | r1_bio->bios[r1_bio->read_disk] = bio; | 1706 | r1_bio->bios[r1_bio->read_disk] = bio; |
1703 | rdev = conf->mirrors[disk].rdev; | 1707 | rdev = conf->mirrors[disk].rdev; |
1704 | if (printk_ratelimit()) | 1708 | if (printk_ratelimit()) |
1705 | printk(KERN_ERR "raid1: redirecting sector %llu to" | 1709 | printk(KERN_ERR "md/raid1:%s: redirecting sector %llu to" |
1706 | " other mirror: %s\n", | 1710 | " other mirror: %s\n", |
1711 | mdname(mddev), | ||
1707 | (unsigned long long)r1_bio->sector, | 1712 | (unsigned long long)r1_bio->sector, |
1708 | bdevname(rdev->bdev,b)); | 1713 | bdevname(rdev->bdev,b)); |
1709 | bio->bi_sector = r1_bio->sector + rdev->data_offset; | 1714 | bio->bi_sector = r1_bio->sector + rdev->data_offset; |
@@ -1760,13 +1765,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1760 | int still_degraded = 0; | 1765 | int still_degraded = 0; |
1761 | 1766 | ||
1762 | if (!conf->r1buf_pool) | 1767 | if (!conf->r1buf_pool) |
1763 | { | ||
1764 | /* | ||
1765 | printk("sync start - bitmap %p\n", mddev->bitmap); | ||
1766 | */ | ||
1767 | if (init_resync(conf)) | 1768 | if (init_resync(conf)) |
1768 | return 0; | 1769 | return 0; |
1769 | } | ||
1770 | 1770 | ||
1771 | max_sector = mddev->dev_sectors; | 1771 | max_sector = mddev->dev_sectors; |
1772 | if (sector_nr >= max_sector) { | 1772 | if (sector_nr >= max_sector) { |
@@ -2047,7 +2047,7 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
2047 | 2047 | ||
2048 | err = -EIO; | 2048 | err = -EIO; |
2049 | if (conf->last_used < 0) { | 2049 | if (conf->last_used < 0) { |
2050 | printk(KERN_ERR "raid1: no operational mirrors for %s\n", | 2050 | printk(KERN_ERR "md/raid1:%s: no operational mirrors\n", |
2051 | mdname(mddev)); | 2051 | mdname(mddev)); |
2052 | goto abort; | 2052 | goto abort; |
2053 | } | 2053 | } |
@@ -2055,7 +2055,7 @@ static conf_t *setup_conf(mddev_t *mddev) | |||
2055 | conf->thread = md_register_thread(raid1d, mddev, NULL); | 2055 | conf->thread = md_register_thread(raid1d, mddev, NULL); |
2056 | if (!conf->thread) { | 2056 | if (!conf->thread) { |
2057 | printk(KERN_ERR | 2057 | printk(KERN_ERR |
2058 | "raid1: couldn't allocate thread for %s\n", | 2058 | "md/raid1:%s: couldn't allocate thread\n", |
2059 | mdname(mddev)); | 2059 | mdname(mddev)); |
2060 | goto abort; | 2060 | goto abort; |
2061 | } | 2061 | } |
@@ -2081,12 +2081,12 @@ static int run(mddev_t *mddev) | |||
2081 | mdk_rdev_t *rdev; | 2081 | mdk_rdev_t *rdev; |
2082 | 2082 | ||
2083 | if (mddev->level != 1) { | 2083 | if (mddev->level != 1) { |
2084 | printk("raid1: %s: raid level not set to mirroring (%d)\n", | 2084 | printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", |
2085 | mdname(mddev), mddev->level); | 2085 | mdname(mddev), mddev->level); |
2086 | return -EIO; | 2086 | return -EIO; |
2087 | } | 2087 | } |
2088 | if (mddev->reshape_position != MaxSector) { | 2088 | if (mddev->reshape_position != MaxSector) { |
2089 | printk("raid1: %s: reshape_position set but not supported\n", | 2089 | printk(KERN_ERR "md/raid1:%s: reshape_position set but not supported\n", |
2090 | mdname(mddev)); | 2090 | mdname(mddev)); |
2091 | return -EIO; | 2091 | return -EIO; |
2092 | } | 2092 | } |
@@ -2129,11 +2129,11 @@ static int run(mddev_t *mddev) | |||
2129 | mddev->recovery_cp = MaxSector; | 2129 | mddev->recovery_cp = MaxSector; |
2130 | 2130 | ||
2131 | if (mddev->recovery_cp != MaxSector) | 2131 | if (mddev->recovery_cp != MaxSector) |
2132 | printk(KERN_NOTICE "raid1: %s is not clean" | 2132 | printk(KERN_NOTICE "md/raid1:%s: not clean" |
2133 | " -- starting background reconstruction\n", | 2133 | " -- starting background reconstruction\n", |
2134 | mdname(mddev)); | 2134 | mdname(mddev)); |
2135 | printk(KERN_INFO | 2135 | printk(KERN_INFO |
2136 | "raid1: raid set %s active with %d out of %d mirrors\n", | 2136 | "md/raid1:%s: active with %d out of %d mirrors\n", |
2137 | mdname(mddev), mddev->raid_disks - mddev->degraded, | 2137 | mdname(mddev), mddev->raid_disks - mddev->degraded, |
2138 | mddev->raid_disks); | 2138 | mddev->raid_disks); |
2139 | 2139 | ||
@@ -2160,7 +2160,8 @@ static int stop(mddev_t *mddev) | |||
2160 | 2160 | ||
2161 | /* wait for behind writes to complete */ | 2161 | /* wait for behind writes to complete */ |
2162 | if (bitmap && atomic_read(&bitmap->behind_writes) > 0) { | 2162 | if (bitmap && atomic_read(&bitmap->behind_writes) > 0) { |
2163 | printk(KERN_INFO "raid1: behind writes in progress on device %s, waiting to stop.\n", mdname(mddev)); | 2163 | printk(KERN_INFO "md/raid1:%s: behind writes in progress - waiting to stop.\n", |
2164 | mdname(mddev)); | ||
2164 | /* need to kick something here to make sure I/O goes? */ | 2165 | /* need to kick something here to make sure I/O goes? */ |
2165 | wait_event(bitmap->behind_wait, | 2166 | wait_event(bitmap->behind_wait, |
2166 | atomic_read(&bitmap->behind_writes) == 0); | 2167 | atomic_read(&bitmap->behind_writes) == 0); |
@@ -2288,9 +2289,9 @@ static int raid1_reshape(mddev_t *mddev) | |||
2288 | if (sysfs_create_link(&mddev->kobj, | 2289 | if (sysfs_create_link(&mddev->kobj, |
2289 | &rdev->kobj, nm)) | 2290 | &rdev->kobj, nm)) |
2290 | printk(KERN_WARNING | 2291 | printk(KERN_WARNING |
2291 | "md/raid1: cannot register " | 2292 | "md/raid1:%s: cannot register " |
2292 | "%s for %s\n", | 2293 | "%s\n", |
2293 | nm, mdname(mddev)); | 2294 | mdname(mddev), nm); |
2294 | } | 2295 | } |
2295 | if (rdev) | 2296 | if (rdev) |
2296 | newmirrors[d2++].rdev = rdev; | 2297 | newmirrors[d2++].rdev = rdev; |