]> sourceware.org Git - lvm2.git/commit
RAID: Limit replacement of devices when array is not in-sync.
authorJonathan Brassow <jbrassow@redhat.com>
Tue, 18 Dec 2012 20:40:42 +0000 (14:40 -0600)
committerJonathan Brassow <jbrassow@redhat.com>
Tue, 18 Dec 2012 20:40:42 +0000 (14:40 -0600)
commit970dfbcd691addb7b69f4011c067eba3b35270b6
treef4dbf2a5e73d9ad3673551630a79dbac03fc096a
parent0379c480e09f0d6e8641bd4d8ca49a8bd3c32943
RAID:  Limit replacement of devices when array is not in-sync.

If a RAID array is not in-sync, replacing devices should not be allowed
as a general rule.  This is because the contents used to populate the
incoming device may be undefined because the devices being read where
not in-sync.  The kernel enforces this rule unless overridden by not
allowing the creation of an array that is not in-sync and includes a
devices that needs to be rebuilt.

Since we cannot know the sync state of an LV if it is inactive, we must
also enforce the rule that an array must be active to replace devices.

That leaves us with the following conditions:
1) never allow replacement or repair of devices if the LV is in-active
2) never allow replacement if the LV is not in-sync
3) allow repair if the LV is not in-sync, but warn that contents may
   not be recoverable.

In the case where a user is performing the repair on the command line via
'lvconvert --repair', the warning is printed before the user is prompted
if they would like to replace the device(s).  If the repair is automated
(i.e. via dmeventd and policy is "allocate"), then the device is replaced
if possible and the warning is printed.
WHATS_NEW
lib/metadata/raid_manip.c
tools/lvconvert.c
This page took 0.040039 seconds and 5 git commands to generate.