lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4C513BF6.5030906@cn.fujitsu.com>
Date:	Thu, 29 Jul 2010 16:29:42 +0800
From:	Miao Xie <miaox@...fujitsu.com>
To:	Chris Mason <chris.mason@...cle.com>,
	Yan Zheng <zheng.yan@...cle.com>
CC:	Linux Btrfs <linux-btrfs@...r.kernel.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>
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@...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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ