[sheepdog] [PATCH 1/2] sheep: fix 'collie vdi object' crashes in a gateway-only node

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


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

When collie tries to read directly from peer which maybe a gateway-only
node, whose store driver is uninitialized, sd_store->read() may causes
sheep crash, so in peer_read_obj() we directly return SD_RES_NO_OBJ if
the node is a gateway-only node

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 0b21f02..cb39956 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -733,6 +733,9 @@ int peer_read_obj(struct request *req)
 	uint32_t epoch = hdr->epoch;
 	struct siocb iocb;
 
+	if (sys->gateway_only)
+		return SD_RES_NO_OBJ;
+
 	memset(&iocb, 0, sizeof(iocb));
 	iocb.epoch = epoch;
 	iocb.flags = hdr->flags;
-- 
1.7.1




More information about the sheepdog mailing list