From: levin li <[email protected]>

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 <[email protected]>
---
 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

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to