]> git.baikalelectronics.ru Git - kernel.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)
committerNeilBrown <neilb@suse.com>
Wed, 22 Jul 2015 04:08:24 +0000 (14:08 +1000)
commit4227645c794df7d188f3165b8bc1b1dc38ae29f3
treeabd3411d0c452e9f8b6e95f106f871042c3d98de
parent02e485a0e9deef5ad4d5ff3ceb6e5fbaf9be1cff
md/raid10: always set reshape_safe when initializing reshape_position.

'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: da909319fc8e ("md/raid10: add reshape support")
Cc: stable@vger.kernel.org (v3.5+ please wait for -final to be out for 2 weeks)
Signed-off-by: NeilBrown <neilb@suse.com>
drivers/md/raid10.c