Re: [mdadm PATCH] Incremental: Use ->validate_geometry instead of ->avail_size

From
Jes Sorensen <jes.sorensen@gmail.com>
Date
2017-11-01 21:27:06
Reply to
NeilBrown, 2017-10-30
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

Thread (2 messages) 2 messages, 2 authors, last reply 2017-11-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help