Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] md: remove 'working_disks' from raid10 state

It isn't needed as mddev->degraded contains equivalent info.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

NeilBrown and committed by
Linus Torvalds
76186dd8 02c2de8c

+4 -9
+4 -8
drivers/md/raid10.c
··· 921 921 seq_printf(seq, " %d far-copies", conf->far_copies); 922 922 } 923 923 seq_printf(seq, " [%d/%d] [", conf->raid_disks, 924 - conf->working_disks); 924 + conf->raid_disks - mddev->degraded); 925 925 for (i = 0; i < conf->raid_disks; i++) 926 926 seq_printf(seq, "%s", 927 927 conf->mirrors[i].rdev && ··· 941 941 * else mark the drive as failed 942 942 */ 943 943 if (test_bit(In_sync, &rdev->flags) 944 - && conf->working_disks == 1) 944 + && conf->raid_disks-mddev->degraded == 1) 945 945 /* 946 946 * Don't fail the drive, just return an IO error. 947 947 * The test should really be more sophisticated than ··· 952 952 return; 953 953 if (test_bit(In_sync, &rdev->flags)) { 954 954 mddev->degraded++; 955 - conf->working_disks--; 956 955 /* 957 956 * if recovery is running, make sure it aborts. 958 957 */ ··· 962 963 set_bit(MD_CHANGE_DEVS, &mddev->flags); 963 964 printk(KERN_ALERT "raid10: Disk failure on %s, disabling device. \n" 964 965 " Operation continuing on %d devices\n", 965 - bdevname(rdev->bdev,b), conf->working_disks); 966 + bdevname(rdev->bdev,b), conf->raid_disks - mddev->degraded); 966 967 } 967 968 968 969 static void print_conf(conf_t *conf) ··· 975 976 printk("(!conf)\n"); 976 977 return; 977 978 } 978 - printk(" --- wd:%d rd:%d\n", conf->working_disks, 979 + printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, 979 980 conf->raid_disks); 980 981 981 982 for (i = 0; i < conf->raid_disks; i++) { ··· 1034 1035 if (tmp->rdev 1035 1036 && !test_bit(Faulty, &tmp->rdev->flags) 1036 1037 && !test_bit(In_sync, &tmp->rdev->flags)) { 1037 - conf->working_disks++; 1038 1038 mddev->degraded--; 1039 1039 set_bit(In_sync, &tmp->rdev->flags); 1040 1040 } ··· 2033 2035 mddev->queue->max_sectors = (PAGE_SIZE>>9); 2034 2036 2035 2037 disk->head_position = 0; 2036 - if (!test_bit(Faulty, &rdev->flags) && test_bit(In_sync, &rdev->flags)) 2037 - conf->working_disks++; 2038 2038 } 2039 2039 conf->raid_disks = mddev->raid_disks; 2040 2040 conf->mddev = mddev;
-1
include/linux/raid/raid10.h
··· 16 16 mddev_t *mddev; 17 17 mirror_info_t *mirrors; 18 18 int raid_disks; 19 - int working_disks; 20 19 spinlock_t device_lock; 21 20 22 21 /* geometry */