md: allow metadata updates while suspending an array - fix
authorNeilBrown <neilb@suse.com>
Wed, 3 Oct 2018 05:04:41 +0000 (15:04 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:23:03 +0000 (08:23 +0100)
commitb6ba15616007f9fe0b10eb6e8f0a9ac014e68a6f
treebde48aabc74a7b836e9f8dbd57b72588e9f85ebd
parent2f41366258fde1ba0b7822e4b841206ff26d9236
md: allow metadata updates while suspending an array - fix

[ Upstream commit 059421e041eb461fb2b3e81c9adaec18ef03ca3c ]

Commit 35bfc52187f6 ("md: allow metadata update while suspending.")
added support for allowing md_check_recovery() to still perform
metadata updates while the array is entering the 'suspended' state.
This is needed to allow the processes of entering the state to
complete.

Unfortunately, the patch doesn't really work.  The test for
"mddev->suspended" at the start of md_check_recovery() means that the
function doesn't try to do anything at all while entering suspend.

This patch moves the code of updating the metadata while suspending to
*before* the test on mddev->suspended.

Reported-by: Jeff Mahoney <jeffm@suse.com>
Fixes: 35bfc52187f6 ("md: allow metadata update while suspending.")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/md.c