From: Miao Xie <miaox@cn.fujitsu.com>
To: Chris Mason <chris.mason@oracle.com>, Yan Zheng <zheng.yan@oracle.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/7] Btrfs: fix increasing num_workers_starting twice
Date: Thu, 29 Jul 2010 16:29:42 +0800 [thread overview]
Message-ID: <4C513BF6.5030906@cn.fujitsu.com> (raw)
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
reply other threads:[~2010-07-29 8:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C513BF6.5030906@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zheng.yan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).