Btrfs: fix increasing num_workers_starting twice
PATCH 4/7 Btrfs: fix increasing num_workers_starting twice
num_workers_starting is increased twice when the btrfs uses generic workers to create a new kthread.
The reason is following:start_new_worker_func() calls btrfs_start_workers() to start a new kthread, this function will add 1 to ->num_workers_starting, but ->num_workers_starting has been increased by check_pending_worker_creates()
we use __btrfs_start_workers() instead of btrfs_start_workers() to fix it.
Signed-off-by Miao Xie <[email protected]>
--- fs/btrfs/async-thread.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
fs/btrfs/async-thread.c +4 -1
@@ -84,11 +84,14 @@ struct worker_start {struct btrfs_workers *queue; }; +static int __btrfs_start_workers (struct btrfs_workers *workers, +int num_workers); +static void start_new_worker_func (struct btrfs_work *work) {struct worker_start *start; start = container_of(work, struct worker_start, work); -btrfs_start_workers (start->queue,1 ); +__btrfs_start_workers (start->queue,1 );kfree (start); }
Signature · 1 line
1.7.0.1