[sheepdog] [PATCH] sheep: gateway cannot cleanup stale objects

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Jun 7 05:35:01 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

sd_store can be NULL if this node is a gateway, so we need the NULL
check before calling sd_store->cleanup.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/ops.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 9a96fc1..2b5c50d 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -680,7 +680,8 @@ static int cluster_recovery_completion(const struct sd_req *req,
 		}
 		if (i == nr_recovereds) {
 			sd_dprintf("all nodes are recovered, epoch %d", epoch);
-			if (sd_store->cleanup)
+			/* sd_store can be NULL if this node is a gateway */
+			if (sd_store && sd_store->cleanup)
 				sd_store->cleanup();
 		}
 	}
-- 
1.7.9.5




More information about the sheepdog mailing list