summaryrefslogtreecommitdiff
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b757da1..e71c5fa 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6044,9 +6044,8 @@ static int md_thread(void * arg)
|| kthread_should_stop(),
thread->timeout);
- clear_bit(THREAD_WAKEUP, &thread->flags);
-
- thread->run(thread->mddev);
+ if (test_and_clear_bit(THREAD_WAKEUP, &thread->flags))
+ thread->run(thread->mddev);
}
return 0;