* [PATCH 4/7] Btrfs: fix increasing num_workers_starting twice
@ 2010-07-29 8:29 Miao Xie
0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2010-07-29 8:29 UTC (permalink / raw)
To: Chris Mason, Yan Zheng; +Cc: Linux Btrfs, Linux Kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-29 8:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 8:29 [PATCH 4/7] Btrfs: fix increasing num_workers_starting twice Miao Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).