[sheepdog] [PATCH v3 4/4] sheep: initialize reference count of local request

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jul 10 16:08:18 CEST 2013


From: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

The patches in this series detected a bug in reference counting of
request. alloc_local_request() doesn't initialize a reference count of
newly allocated request. This patch fixes this problem.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/request.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sheep/request.c b/sheep/request.c
index fc1fccf..3b43c76 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -424,6 +424,8 @@ static struct request *alloc_local_request(void *data, int data_length)
 
 	INIT_LIST_HEAD(&req->request_list);
 
+	refcount_set(&req->refcnt, 1);
+
 	return req;
 }
 
-- 
1.7.5.1




More information about the sheepdog mailing list