[sheepdog] [PATCH v2] collie: give more user friendly error message for 'vdi check'

Liu Yuan namei.unix at gmail.com
Fri Jan 25 04:06:50 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

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

diff --git a/collie/vdi.c b/collie/vdi.c
index b5af7a9..7aa7453 100644
--- a/collie/vdi.c
+++ b/collie/vdi.c
@@ -1506,6 +1506,11 @@ 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,"ABORT: Not enough active nodes for "
+			"consistency-check\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 mailing list