lkml.org 
[lkml]   [2010]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[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 <miaox@cn.fujitsu.com>
---
fs/btrfs/async-thread.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 7ec1409..eb3ec2d 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -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);
}

--
1.7.0.1

\
 
 \ /
  Last update: 2010-07-29 11:09    [W:0.027 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site