aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-05-28 21:40:03 -0400
committerNeilBrown <neilb@suse.de>2014-05-29 02:59:06 -0400
commit2ac295a544dcae9299cba13ce250419117ae7fd1 (patch)
treec0b7dba79124ab8c4cb7fd5c639b34c0a993e715 /drivers/md/md.c
parent3991b31ea072b070081ca3bfa860a077eda67de5 (diff)
md: always set MD_RECOVERY_INTR when interrupting a reshape thread.
Commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 md: fix problem when adding device to read-only array with bitmap. added a called to md_reap_sync_thread() which cause a reshape thread to be interrupted (in particular, it could cause md_thread() to never even call md_do_sync()). However it didn't set MD_RECOVERY_INTR so ->finish_reshape() would not know that the reshape didn't complete. This only happens when mddev->ro is set and normally reshape threads don't run in that situation. But raid5 and raid10 can start a reshape thread during "run" is the array is in the middle of a reshape. They do this even if ->ro is set. So it is best to set MD_RECOVERY_INTR before abortingg the sync thread, just in case. Though it rare for this to trigger a problem it can cause data corruption because the reshape isn't finished properly. So it is suitable for any stable which the offending commit was applied to. (3.2 or later) Fixes: 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 Cc: stable@vger.kernel.org (3.2+) Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 48a99b75682c..2382cfc9bb3f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7826,6 +7826,7 @@ void md_check_recovery(struct mddev *mddev)
7826 /* There is no thread, but we need to call 7826 /* There is no thread, but we need to call
7827 * ->spare_active and clear saved_raid_disk 7827 * ->spare_active and clear saved_raid_disk
7828 */ 7828 */
7829 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
7829 md_reap_sync_thread(mddev); 7830 md_reap_sync_thread(mddev);
7830 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 7831 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
7831 goto unlock; 7832 goto unlock;