[sheepdog] [PATCH stable-0.6 1/4] sheep: gateway cannot cleanup stale objects

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Jul 4 11:46:30 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>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 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.10.4




More information about the sheepdog mailing list