summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2015-03-23 17:33:41 -0700
committerKent Overstreet <kent.overstreet@gmail.com>2016-10-07 12:33:37 -0800
commit6d32338b98ce01d63b8faeb8794e4fbf2369c038 (patch)
treec4a58753104a5772e7c7aeb897445e1b4bbdb651
parent5fa5a6086f50b45ead6f87ee7f015f27de43c342 (diff)
bcache: Fix more sleeping while interruptible splats
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--drivers/md/bcache/alloc.c4
-rw-r--r--drivers/md/bcache/gc.c4
-rw-r--r--drivers/md/bcache/util.c4
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();