aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/async-thread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index c84ca1f5259a..cba701dba350 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -195,6 +195,9 @@ again_locked:
195 if (!list_empty(&worker->pending)) 195 if (!list_empty(&worker->pending))
196 continue; 196 continue;
197 197
198 if (kthread_should_stop())
199 break;
200
198 /* still no more work?, sleep for real */ 201 /* still no more work?, sleep for real */
199 spin_lock_irq(&worker->lock); 202 spin_lock_irq(&worker->lock);
200 set_current_state(TASK_INTERRUPTIBLE); 203 set_current_state(TASK_INTERRUPTIBLE);
@@ -208,7 +211,8 @@ again_locked:
208 worker->working = 0; 211 worker->working = 0;
209 spin_unlock_irq(&worker->lock); 212 spin_unlock_irq(&worker->lock);
210 213
211 schedule(); 214 if (!kthread_should_stop())
215 schedule();
212 } 216 }
213 __set_current_state(TASK_RUNNING); 217 __set_current_state(TASK_RUNNING);
214 } 218 }