NeilBrown 312045eef9 md: remove check for MD_RECOVERY_NEEDED in action_store.
md currently doesn't allow a 'sync_action' such as 'reshape' to be set
while MD_RECOVERY_NEEDED is set.

This s a problem, particularly since commit 738a273806ee as that can
cause ->check_shape to call mddev_resume() which sets
MD_RECOVERY_NEEDED.  So by the time we come to start 'reshape' it is
very likely that MD_RECOVERY_NEEDED is still set.

Testing for this flag is not really needed and is in any case very
racy as it can be set at any moment - asynchronously.  Any race
between setting a sync_action and setting MD_RECOVERY_NEEDED must
already be handled properly in some locked code, probably
md_check_recovery(), so remove the test here.

The test on MD_RECOVERY_RUNNING is also racy in the 'reshape' case
so we should test it again after getting mddev_lock().

As this fixes a race and a regression which can cause 'reshape' to
fail, it is suitable for -stable kernels since 4.1

Reported-by: Xiao Ni <xni@redhat.com>
Fixes: 738a273806ee ("md/raid5: fix allocation of 'scribble' array.")
Cc: stable@vger.kernel.org (v4.1+)
Signed-off-by: NeilBrown <neilb@suse.com>
2015-12-21 11:10:06 +11:00
..
2015-10-31 19:06:01 -04:00
2014-01-14 23:23:03 -05:00
2015-10-31 19:06:01 -04:00
2015-10-31 19:06:01 -04:00
2015-10-31 19:05:59 -04:00
2015-10-31 19:05:59 -04:00
2012-07-30 17:25:16 -07:00
2015-10-31 19:06:01 -04:00
2015-10-31 19:05:59 -04:00
2015-08-13 12:31:57 -06:00
2015-10-24 17:16:19 +11:00
2015-12-18 15:19:16 +11:00
2015-08-13 12:31:57 -06:00
2015-11-04 21:12:47 -08:00
2015-11-04 21:12:47 -08:00
2015-11-01 13:48:29 +11:00