[sheepdog] [PATCH] lib/work: initialize `tid_max` to 1

Jinzhi Chen nxtjinzhi at gmail.com
Wed Oct 29 06:53:14 CET 2014


journal thread uses `tid_max` which is not initialized until
later initial progress. The default value 0 cause journal
thread  loop in the function `trace_set_tid_map` , so set
default value to 1.

Signed-off-by: jinzhichen <nxtjinzhi at gmail.com>
---
 lib/work.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/work.c b/lib/work.c
index 7e2cd79..7b20685 100644
--- a/lib/work.c
+++ b/lib/work.c
@@ -75,7 +75,7 @@ static void *worker_routine(void *arg);

 #define TID_MAX_DEFAULT 0x8000 /* default maximum tid for most systems */

-static size_t tid_max;
+static size_t tid_max = 1;
 static unsigned long *tid_map;
 static struct sd_mutex tid_map_lock = SD_MUTEX_INITIALIZER;

-- 
1.7.9.5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20141029/4358e2ba/attachment-0003.html>


More information about the sheepdog mailing list