md: allow setting newly added device to 'in_sync' via sysfs.

When adding devices to an active array via sysfs, there is currently
no way to mark a device as 'in-sync' which is useful when
incrementally assembling an array.

So add that option.

Signed-off-by: NeilBrown <neilb@suse.de>

NeilBrown 6d56e278 63fe0817

+5 -1
+5 -1
drivers/md/md.c
··· 2086 2086 * -writemostly - clears write_mostly 2087 2087 * blocked - sets the Blocked flag 2088 2088 * -blocked - clears the Blocked flag 2089 + * insync - sets Insync providing device isn't active 2089 2090 */ 2090 2091 int err = -EINVAL; 2091 2092 if (cmd_match(buf, "faulty") && rdev->mddev->pers) { ··· 2118 2117 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); 2119 2118 md_wakeup_thread(rdev->mddev->thread); 2120 2119 2120 + err = 0; 2121 + } else if (cmd_match(buf, "insync") && rdev->raid_disk == -1) { 2122 + set_bit(In_sync, &rdev->flags); 2121 2123 err = 0; 2122 2124 } 2123 2125 if (!err && rdev->sysfs_state) ··· 2194 2190 } else if (rdev->mddev->pers) { 2195 2191 mdk_rdev_t *rdev2; 2196 2192 /* Activating a spare .. or possibly reactivating 2197 - * if we every get bitmaps working here. 2193 + * if we ever get bitmaps working here. 2198 2194 */ 2199 2195 2200 2196 if (rdev->raid_disk != -1)