Skip to content

Commit b983471

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: BUG to BUG_ON changes Btrfs: remove dead code Btrfs: remove dead code Btrfs: fix typos in comments Btrfs: remove unused ftrace include Btrfs: fix __ucmpdi2 compile bug on 32 bit builds Btrfs: free inode struct when btrfs_new_inode fails Btrfs: fix race in worker_loop Btrfs: add flushoncommit mount option Btrfs: notreelog mount option Btrfs: introduce btrfs_show_options Btrfs: rework allocation clustering Btrfs: Optimize locking in btrfs_next_leaf() Btrfs: break up btrfs_search_slot into smaller pieces Btrfs: kill the pinned_mutex Btrfs: kill the block group alloc mutex Btrfs: clean up find_free_extent Btrfs: free space cache cleanups Btrfs: unplug in the async bio submission threads Btrfs: keep processing bios for a given bdev if our proc is batching
2 parents 5a3ae27 + c293498 commit b983471

17 files changed

Lines changed: 982 additions & 544 deletions

‎fs/btrfs/async-thread.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/list.h>
2121
#include <linux/spinlock.h>
2222
#include <linux/freezer.h>
23-
#include <linux/ftrace.h>
2423
#include "async-thread.h"
2524

2625
#define WORK_QUEUED_BIT 0
@@ -195,6 +194,9 @@ static int worker_loop(void *arg)
195194
if (!list_empty(&worker->pending))
196195
continue;
197196

197+
if (kthread_should_stop())
198+
break;
199+
198200
/* still no more work?, sleep for real */
199201
spin_lock_irq(&worker->lock);
200202
set_current_state(TASK_INTERRUPTIBLE);
@@ -208,7 +210,8 @@ static int worker_loop(void *arg)
208210
worker->working = 0;
209211
spin_unlock_irq(&worker->lock);
210212

211-
schedule();
213+
if (!kthread_should_stop())
214+
schedule();
212215
}
213216
__set_current_state(TASK_RUNNING);
214217
}

0 commit comments

Comments
 (0)