]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Use action policy to keep recently-disconnected devices in the array.
authorNeilBrown <neilb@suse.de>
Mon, 23 Aug 2010 05:54:13 +0000 (15:54 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 6 Sep 2010 01:26:27 +0000 (11:26 +1000)
commit7e83544bc43f7a7b96e769be6e4d20373496cefc
tree12a5317521474b38648bc364cb074447d0364c01
parent15d4a7e44748e0b71315ec2e14f0a0f959b82568
Use action policy to keep recently-disconnected devices in the array.

When we find a device that was recently part of the array but is now
out of date (based on the event count) we might want to add it back in
(like --re-add) if the likely cause was a connection problem or we
might not if the likely cause was device failure.

So make this a policy issue: if action=re-add or better, try to re-add
any device that looks like it might be part of the array.

This applies:
  when we assemble the array:  old devices will be evicted by the
     kernel and need to be re-added.
  when we assemble the array during --incr for the same reason.
  when we find a device that could be added to a running array.

This doesn't affect arrays with external metadata at all.
For such arrays:
 When the container is assembled, the most recent instance of each
 device is included without reference to whether it is too old or not.
 Then the metadata handler must which slices of which devices to
 include in which array and with what state.  So the
 ->container_content should probably check the policy and compare the
 sequence numbers/event counts.
 When a device is added (--add) to a container with active arrays
 we only add as a 'spare'. --re-add doesn't seem to be an option.
 When a device is added with -I ->container_content gets another
 chance to assess things again.  So again it should check the policy.

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