[Sheepdog] [PATCH] sheep: avoid calling get_vnode_info() against force operations

MORITA Kazutaka morita.kazutaka at gmail.com
Thu May 3 20:53:32 CEST 2012


The force operations can be processed before we set up
current_vnode_info.  For example, when we start the cluster, sheep
daemons can receive SD_OP_READ_VDIS requests from other nodes before
setting current_vnode_info.  So the force operations shouldn't access
req->vnodes in their process_work() and process_main().

Signed-off-by: MORITA Kazutaka <morita.kazutaka at gmail.com>
---
 sheep/sdnet.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 1e001af..f59b1ff 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -297,7 +297,14 @@ static void queue_request(struct request *req)
 		break;
 	}
 
-	req->vnodes = get_vnode_info();
+	/*
+	 * force operations shouldn't access req->vnodes in their
+	 * process_work() and process_main() because they can be
+	 * called before we set up current_vnode_info
+	 */
+	if (!is_force_op(req->op))
+		req->vnodes = get_vnode_info();
+
 	if (is_io_op(req->op)) {
 		req->work.fn = do_io_request;
 		req->work.done = io_op_done;
-- 
1.7.2.5




More information about the sheepdog mailing list