[sheepdog] [PATCH v2 08/10] sheep: recover objects in the ordered worker thread

MORITA Kazutaka morita.kazutaka at gmail.com
Thu May 9 04:38:57 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

The current recovery code are not expected to work in multi threads.  However,
cluster_enable_recover() can queue a new recovery work even if there is a
running one.  To avoid this problem, this patch uses an ordered work queue for
the recovery work.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/sheep.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/sheep.c b/sheep/sheep.c
index a7e3820..05fced5 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -338,7 +338,7 @@ static int init_work_queues(void)
 
 	sys->gateway_wqueue = init_work_queue("gway", WQ_UNLIMITED);
 	sys->io_wqueue = init_work_queue("io", WQ_UNLIMITED);
-	sys->recovery_wqueue = init_work_queue("rw", WQ_UNLIMITED);
+	sys->recovery_wqueue = init_ordered_work_queue("rw");
 	sys->deletion_wqueue = init_ordered_work_queue("deletion");
 	sys->block_wqueue = init_ordered_work_queue("block");
 	sys->sockfd_wqueue = init_ordered_work_queue("sockfd");
-- 
1.7.9.5




More information about the sheepdog mailing list