aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorGravatar NeilBrown <neilb@suse.de> 2013-04-24 11:42:42 +1000
committerGravatar NeilBrown <neilb@suse.de> 2013-04-24 11:42:42 +1000
commit7ceb17e87bde79d285a8b988cfed9eaeebe60b86 (patch)
tree72924d5eb98bf7740148db5e136f873680b79c97 /drivers/md/md.h
parentmd/raid10: Allow skipping recovery when clean arrays are assembled (diff)
downloadlinux-7ceb17e87bde79d285a8b988cfed9eaeebe60b86.tar.gz
linux-7ceb17e87bde79d285a8b988cfed9eaeebe60b86.tar.bz2
linux-7ceb17e87bde79d285a8b988cfed9eaeebe60b86.zip
md: Allow devices to be re-added to a read-only array.
When assembling an array incrementally we might want to make it device available when "enough" devices are present, but maybe not "all" devices are present. If the remaining devices appear before the array is actually used, they should be added transparently. We do this by using the "read-auto" mode where the array acts like it is read-only until a write request arrives. Current an add-device request switches a read-auto array to active. This means that only one device can be added after the array is first made read-auto. This isn't a problem for RAID5, but is not ideal for RAID6 or RAID10. Also we don't really want to switch the array to read-auto at all when re-adding a device as this doesn't really imply any change. So: - remove the "md_update_sb()" call from add_new_disk(). This isn't really needed as just adding a disk doesn't require a metadata update. Instead, just set MD_CHANGE_DEVS. This will effect a metadata update soon enough, once the array is not read-only. - Allow the ADD_NEW_DISK ioctl to succeed without activating a read-auto array, providing the MD_DISK_SYNC flag is set. In this case, the device will be rejected if it cannot be added with the correct device number, or has an incorrect event count. - Teach remove_and_add_spares() to be careful about adding spares when the array is read-only (or read-mostly) - only add devices that are thought to be in-sync, and only do it if the array is in-sync itself. - In md_check_recovery, use remove_and_add_spares in the read-only case, rather than open coding just the 'remove' part of it. Reported-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
0 files changed, 0 insertions, 0 deletions