]> git.ipfire.org Git - thirdparty/mdadm.git/commit
imsm: update num_data_stripes according to dev_size
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Tue, 24 Nov 2020 13:15:15 +0000 (14:15 +0100)
committerJes Sorensen <jsorensen@fb.com>
Wed, 25 Nov 2020 23:07:11 +0000 (18:07 -0500)
commit895ffd992954069e4ea67efb8a85bb0fd72c3707
tree757a1c7c4b84cae68735befde4619d5b4a28e65d
parentce559078a5650afb9f635204b31a89a1fa0061e3
imsm: update num_data_stripes according to dev_size

If array was created in UEFI there is possibility that
member size is not rounded to 1MB. After any size reconfiguration
it will be rounded down to 1MB per each member but the old
component size will remain in metadata.
During reshape old array size is calculated from component size because
dev_size is not a part of map and is bumped to new value quickly.
It may result in size mismatch if array is assembled during reshape.

If difference in calculated size and dev_size is observed try to fix it.
num_data_stripes value can be safety updated to smaller value if array
doesn't occuppy whole reserved component space.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
super-intel.c