[sheepdog] [PATCH 2/4] sheep: handle error of notify_vdi_add()

Kai Zhang kyle at zelin.io
Sat Jul 6 03:59:06 CEST 2013


Signed-off-by: Kai Zhang <kyle at zelin.io>
---
 sheep/vdi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 41e451e..e72ae18 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -540,7 +540,9 @@ int vdi_create(struct vdi_iocb *iocb, uint32_t *new_vid)
 	if (!iocb->snapid)
 		iocb->snapid = 1;
 	*new_vid = info.free_bit;
-	notify_vdi_add(*new_vid, iocb->nr_copies, info.vid);
+	ret = notify_vdi_add(*new_vid, iocb->nr_copies, info.vid);
+	if (ret != SD_RES_SUCCESS)
+		return ret;
 
 	sd_dprintf("%s %s: size %" PRIu64 ", vid %" PRIx32 ", base %" PRIx32
 		   ", cur %" PRIx32 ", copies %d, snapid %"PRIu32,
-- 
1.7.9.5




More information about the sheepdog mailing list