[sheepdog] [PATCH 2/2] sheep: fix 'collie cluster cleanup' crash in gateway-only node

levin li levin108 at gmail.com
Mon Aug 6 04:14:15 CEST 2012


From: levin li <xingke.lwp at taobao.com>

In gateway-only node, store driver maybe unitialized after restart,
so cluster_cleanup() in gateway-only node crashed when we try to
call sd_store->cleanup()

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/ops.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index cb39956..0cddf66 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -530,6 +530,9 @@ static int cluster_cleanup(const struct sd_req *req, struct sd_rsp *rsp,
 	if (node_in_recovery())
 		return SD_RES_NODE_IN_RECOVERY;
 
+	if (sys->gateway_only)
+		return SD_RES_SUCCESS;
+
 	if (sd_store->cleanup)
 		ret = sd_store->cleanup(&iocb);
 	else
-- 
1.7.1




More information about the sheepdog mailing list