[sheepdog-users] Impossible to run vdi check with 1 node

Liu Yuan namei.unix at gmail.com
Thu Jan 24 11:55:02 CET 2013


On 01/24/2013 06:22 PM, MORITA Kazutaka wrote:
> Panic is not appropriate here.  We should exit with an user friendly
> message.

Makes sense, there is the patch

>From b2ba8f9ef3d0929ff001f4ae1e2c60625880eeeb Mon Sep 17 00:00:00 2001
From: Liu Yuan <tailai.ly at taobao.com>
Date: Thu, 24 Jan 2013 18:53:58 +0800
Subject: [PATCH] collie: give more user friendly error message for 'vdi
 check'

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 collie/vdi.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/collie/vdi.c b/collie/vdi.c
index b5af7a9..5f2a889 100644
--- a/collie/vdi.c
+++ b/collie/vdi.c
@@ -1506,6 +1506,10 @@ static int vdi_check(int argc, char **argv)
 		fprintf(stderr, "FATAL: no inode objects\n");
 		goto out;
 	}
+	if (sd_nodes_nr < inode->nr_copies){
+		fprintf(stderr, "FATAL: do not have enough nodes\n");
+		return EXIT_FAILURE;
+	}
 
 	do_check_repair(vid_to_vdi_oid(vid), inode->nr_copies);
 	total = inode->vdi_size;
-- 
1.7.9.5




More information about the sheepdog-users mailing list