On 10/30/2017 12:43 AM, NeilBrown wrote:
Since mdadm 3.3 is has not been correct to call ->avail_size if
metadata hasn't been read from the device. ->validate_geometry
should be used instead.
Unfortunately array_try_spare() didn't get the memo, and it can crash
when adding a spare with no metdata.
So change it to use ->validate_geometry().
Only one place remains that uses ->avail_size(), and that is safe.
Also fix a comment with a typo.
Reported-and-tested-by: Bjørnar Ness <redacted>
Fixes: 641da7459192 ("super1: separate to version of _avail_space1().")
Signed-off-by: NeilBrown <redacted>
---
Incremental.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Memo sent to array_try_spare()!
Thanks,
Jes