diff options
-rw-r--r-- | drivers/md/bcache/alloc.c | 4 | ||||
-rw-r--r-- | drivers/md/bcache/gc.c | 4 | ||||
-rw-r--r-- | drivers/md/bcache/util.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index d9bee1c25d4d..a03859aa25cb 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -777,8 +777,10 @@ static int bch_allocator_thread(void *arg) if (bch_allocator_push(ca, bucket)) break; - if (kthread_should_stop()) + if (kthread_should_stop()) { + __set_current_state(TASK_RUNNING); goto out; + } schedule(); } diff --git a/drivers/md/bcache/gc.c b/drivers/md/bcache/gc.c index 4879b11ad2a7..42c97b2984ca 100644 --- a/drivers/md/bcache/gc.c +++ b/drivers/md/bcache/gc.c @@ -680,8 +680,10 @@ static int bch_gc_thread(void *arg) for_each_cache(ca, c, i) bch_wake_allocator(ca); - if (kthread_should_stop()) + if (kthread_should_stop()) { + __set_current_state(TASK_RUNNING); break; + } schedule(); try_to_freeze(); diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c index ff33161dff5f..bf13a9361716 100644 --- a/drivers/md/bcache/util.c +++ b/drivers/md/bcache/util.c @@ -506,8 +506,10 @@ int bch_kthread_loop_ratelimit(unsigned long *last, unsigned long delay) unsigned long next = *last + delay; set_current_state(TASK_INTERRUPTIBLE); - if (kthread_should_stop()) + if (kthread_should_stop()) { + __set_current_state(TASK_RUNNING); return -1; + } schedule_timeout(max_t(long, 0, next - jiffies)); try_to_freeze(); |