]> git.ipfire.org Git - thirdparty/mdadm.git/commit
imsm: fix spare activation for old matrix arrays
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Fri, 8 Mar 2019 11:19:11 +0000 (12:19 +0100)
committerJes Sorensen <jsorensen@fb.com>
Wed, 10 Apr 2019 13:36:46 +0000 (09:36 -0400)
commit05501181f18cdccdb0b3cec1d8cf59f0995504d7
treef41a97854deecbec39b0f281925f5497e304e500
parent227aeaa872d4898273cf87a4253898823d556c43
imsm: fix spare activation for old matrix arrays

During spare activation get_extents() calculates metadata reserved space based
on smallest active RAID member or it will take the defaults. Since patch
611d9529("imsm: change reserved space to 4MB") default is extended.  If array
was created prior that patch, reserved space is smaller. In case of matrix
RAID - spare is activated in each array one-by-one, so it is spare for first
activation, but treated as "active" during second one.

In case of adding spare drive to old matrix RAID with the size the same as
already existing member drive the routine will take the defaults during second
run and mdmon will refuse to rebuild second volume, claiming that the drive
does not have enough free space.

Add parameter to get_extents(), so the during spare activation reserved space
is always based on smallest active drive - even if given drive is already
active in some other array of matrix RAID.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c