]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
imsm: Calculate reservation for a spare based on active disks in container
authorCzarnowska, Anna <anna.czarnowska@intel.com>
Mon, 19 Sep 2011 12:57:48 +0000 (12:57 +0000)
committerNeilBrown <neilb@suse.de>
Wed, 21 Sep 2011 04:44:35 +0000 (14:44 +1000)
commitb81221b74eba9fd7f670a8d3d4bfbda43ec91993
treefc9595a7f0d7713e798cbc7c89e0ecf6be6c51e5
parentecbd9e8160e9de9cc28ad869d303506b1dc69715
imsm: Calculate reservation for a spare based on active disks in container

New function to calculate minimum reservation to expect from a spare
is introduced.

The required amount of space at the end of the disk depends on what we
plan to do with the spare and what array we want to use it in.
For creating new subarray in an empty container the full reservation of
MPB_SECTOR_COUNT + IMSM_RESERVED_SECTORS is required.

For recovery or OLCE on a volume using new metadata format at least
MPB_SECTOR_CNT + NUM_BLOCKS_DIRTY_STRIPE_REGION is required.
The additional space for migration optimization included in
IMSM_RESERVED_SECTORS is not necessary and is not reserved by some oroms.

MPB_SECTOR_CNT alone is not sufficient as it does not include the
reservation at the end of subarray.

However if the real reservation on active disks is smaller than this
(when the array uses old metadata format) we should use the real value.
This will allow OLCE and recovery to start on the spare even if the volume
doesn't have the reservation we normally use for new volumes.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c