Skip to content
Commit c7af5eb4 authored by NeilBrown's avatar NeilBrown Committed by Jiri Slaby
Browse files

md/raid10: always set reshape_safe when initializing reshape_position.

commit 299b0685 upstream.

'reshape_position' tracks where in the reshape we have reached.
'reshape_safe' tracks where in the reshape we have safely recorded
in the metadata.

These are compared to determine when to update the metadata.
So it is important that reshape_safe is initialised properly.
Currently it isn't.  When starting a reshape from the beginning
it usually has the correct value by luck.  But when reducing the
number of devices in a RAID10, it has the wrong value and this leads
to the metadata not being updated correctly.
This can lead to corruption if the reshape is not allowed to complete.

This patch is suitable for any -stable kernel which supports RAID10
reshape, which is 3.5 and later.

Fixes: 3ea7daa5

 ("md/raid10: add reshape support")
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent cefcb16c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment