aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e9476075aa13..2a8a5696bf8a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3568,7 +3568,8 @@ static void md_do_sync(mddev_t *mddev)
3568 mddev->curr_resync = 2; 3568 mddev->curr_resync = 2;
3569 3569
3570 try_again: 3570 try_again:
3571 if (signal_pending(current)) { 3571 if (signal_pending(current) ||
3572 kthread_should_stop()) {
3572 flush_signals(current); 3573 flush_signals(current);
3573 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 3574 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
3574 goto skip; 3575 goto skip;
@@ -3590,8 +3591,9 @@ static void md_do_sync(mddev_t *mddev)
3590 */ 3591 */
3591 continue; 3592 continue;
3592 prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE); 3593 prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE);
3593 if (!signal_pending(current) 3594 if (!signal_pending(current) &&
3594 && mddev2->curr_resync >= mddev->curr_resync) { 3595 !kthread_should_stop() &&
3596 mddev2->curr_resync >= mddev->curr_resync) {
3595 printk(KERN_INFO "md: delaying resync of %s" 3597 printk(KERN_INFO "md: delaying resync of %s"
3596 " until %s has finished resync (they" 3598 " until %s has finished resync (they"
3597 " share one or more physical units)\n", 3599 " share one or more physical units)\n",
@@ -3697,7 +3699,7 @@ static void md_do_sync(mddev_t *mddev)
3697 } 3699 }
3698 3700
3699 3701
3700 if (signal_pending(current)) { 3702 if (signal_pending(current) || kthread_should_stop()) {
3701 /* 3703 /*
3702 * got a signal, exit. 3704 * got a signal, exit.
3703 */ 3705 */