From 19b43f153568af86138a2e86128099c4d9154b26 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 15 Nov 2005 00:09:12 -0800 Subject: [PATCH] --- yaml --- r: 14232 b: refs/heads/master c: 93588e2284b6be1873cc0bb7fbf0947bdbf72830 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/md/md.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 38463a46f8f5..16f79f66f1a7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e8a0033451f7972169b2f375be34d9d805ad8687 +refs/heads/master: 93588e2284b6be1873cc0bb7fbf0947bdbf72830 diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index a9f032e341cb..f3fed662f32e 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -3437,10 +3437,19 @@ static int md_thread(void * arg) allow_signal(SIGKILL); while (!kthread_should_stop()) { - wait_event_timeout(thread->wqueue, - test_bit(THREAD_WAKEUP, &thread->flags) - || kthread_should_stop(), - thread->timeout); + /* We need to wait INTERRUPTIBLE so that + * we don't add to the load-average. + * That means we need to be sure no signals are + * pending + */ + if (signal_pending(current)) + flush_signals(current); + + wait_event_interruptible_timeout + (thread->wqueue, + test_bit(THREAD_WAKEUP, &thread->flags) + || kthread_should_stop(), + thread->timeout); try_to_freeze(); clear_bit(THREAD_WAKEUP, &thread->flags);