From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Chris Mason <chris.mason@oracle.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] btrfs/async-thread.c: decrease workers->num_workers only on worker can be freed in btrfs_stop_workers
Date: Fri, 16 Mar 2012 11:04:40 +0800 [thread overview]
Message-ID: <4F62ADC8.1030502@gmail.com> (raw)
If the worker cannot be freed, decrease workers->num_workers can
corrupt the statistics. The workers->num_workers should be decreased
only when the worker can be stopped and freed in btrfs_stop_workers.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
fs/btrfs/async-thread.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 0cc20b3..5a7d756 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -413,9 +413,9 @@ int btrfs_stop_workers(struct btrfs_workers *workers)
worker_list);
atomic_inc(&worker->refs);
- workers->num_workers -= 1;
if (!list_empty(&worker->worker_list)) {
list_del_init(&worker->worker_list);
+ workers->num_workers--;
put_worker(worker);
can_stop = 1;
} else
--
1.7.1
reply other threads:[~2012-03-16 3:05 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=4F62ADC8.1030502@gmail.com \
--to=shhuiw@gmail.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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