aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid10.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 85e3df2d268a..233a4faede94 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -921,7 +921,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
921 seq_printf(seq, " %d far-copies", conf->far_copies); 921 seq_printf(seq, " %d far-copies", conf->far_copies);
922 } 922 }
923 seq_printf(seq, " [%d/%d] [", conf->raid_disks, 923 seq_printf(seq, " [%d/%d] [", conf->raid_disks,
924 conf->working_disks); 924 conf->raid_disks - mddev->degraded);
925 for (i = 0; i < conf->raid_disks; i++) 925 for (i = 0; i < conf->raid_disks; i++)
926 seq_printf(seq, "%s", 926 seq_printf(seq, "%s",
927 conf->mirrors[i].rdev && 927 conf->mirrors[i].rdev &&
@@ -941,7 +941,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
941 * else mark the drive as failed 941 * else mark the drive as failed
942 */ 942 */
943 if (test_bit(In_sync, &rdev->flags) 943 if (test_bit(In_sync, &rdev->flags)
944 && conf->working_disks == 1) 944 && conf->raid_disks-mddev->degraded == 1)
945 /* 945 /*
946 * Don't fail the drive, just return an IO error. 946 * Don't fail the drive, just return an IO error.
947 * The test should really be more sophisticated than 947 * The test should really be more sophisticated than
@@ -952,7 +952,6 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
952 return; 952 return;
953 if (test_bit(In_sync, &rdev->flags)) { 953 if (test_bit(In_sync, &rdev->flags)) {
954 mddev->degraded++; 954 mddev->degraded++;
955 conf->working_disks--;
956 /* 955 /*
957 * if recovery is running, make sure it aborts. 956 * if recovery is running, make sure it aborts.
958 */ 957 */
@@ -963,7 +962,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
963 set_bit(MD_CHANGE_DEVS, &mddev->flags); 962 set_bit(MD_CHANGE_DEVS, &mddev->flags);
964 printk(KERN_ALERT "raid10: Disk failure on %s, disabling device. \n" 963 printk(KERN_ALERT "raid10: Disk failure on %s, disabling device. \n"
965 " Operation continuing on %d devices\n", 964 " Operation continuing on %d devices\n",
966 bdevname(rdev->bdev,b), conf->working_disks); 965 bdevname(rdev->bdev,b), conf->raid_disks - mddev->degraded);
967} 966}
968 967
969static void print_conf(conf_t *conf) 968static void print_conf(conf_t *conf)
@@ -976,7 +975,7 @@ static void print_conf(conf_t *conf)
976 printk("(!conf)\n"); 975 printk("(!conf)\n");
977 return; 976 return;
978 } 977 }
979 printk(" --- wd:%d rd:%d\n", conf->working_disks, 978 printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded,
980 conf->raid_disks); 979 conf->raid_disks);
981 980
982 for (i = 0; i < conf->raid_disks; i++) { 981 for (i = 0; i < conf->raid_disks; i++) {
@@ -1035,7 +1034,6 @@ static int raid10_spare_active(mddev_t *mddev)
1035 if (tmp->rdev 1034 if (tmp->rdev
1036 && !test_bit(Faulty, &tmp->rdev->flags) 1035 && !test_bit(Faulty, &tmp->rdev->flags)
1037 && !test_bit(In_sync, &tmp->rdev->flags)) { 1036 && !test_bit(In_sync, &tmp->rdev->flags)) {
1038 conf->working_disks++;
1039 mddev->degraded--; 1037 mddev->degraded--;
1040 set_bit(In_sync, &tmp->rdev->flags); 1038 set_bit(In_sync, &tmp->rdev->flags);
1041 } 1039 }
@@ -2035,8 +2033,6 @@ static int run(mddev_t *mddev)
2035 mddev->queue->max_sectors = (PAGE_SIZE>>9); 2033 mddev->queue->max_sectors = (PAGE_SIZE>>9);
2036 2034
2037 disk->head_position = 0; 2035 disk->head_position = 0;
2038 if (!test_bit(Faulty, &rdev->flags) && test_bit(In_sync, &rdev->flags))
2039 conf->working_disks++;
2040 } 2036 }
2041 conf->raid_disks = mddev->raid_disks; 2037 conf->raid_disks = mddev->raid_disks;
2042 conf->mddev = mddev; 2038 conf->mddev = mddev;