]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/raid10: always set reshape_safe when initializing reshape_position.
authorNeilBrown <neilb@suse.com>
Mon, 6 Jul 2015 07:37:49 +0000 (17:37 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2015 10:07:32 +0000 (12:07 +0200)
commitd3e972d5e77997cf0944d2c91162a9e893264c92
tree31c4fac1601dcecc23e90df3516e28a612960775
parentab7a4b4b9d31e0458a5f327d1da66d649d814066
md/raid10: always set reshape_safe when initializing reshape_position.

commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 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: 3ea7daa5d7fd ("md/raid10: add reshape support")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid10.c