From 5b28bd56725371d4a72988d4e72bb2fd852c6fa7 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 21 May 2007 14:25:47 +1000 Subject: Improve error message for adding bitmap to a level that cannot support it. Also give error on --build if no devices given. --- Build.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Build.c') diff --git a/Build.c b/Build.c index df9f4f2..1de3596 100644 --- a/Build.c +++ b/Build.c @@ -146,6 +146,12 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout, fprintf(stderr, Name ": bitmaps not supported with this kernel\n"); return 1; } + + if (bitmap_file && level <= 0) { + fprintf(stderr, Name ": bitmaps not meaningful with level %s\n", + map_num(pers, level)?:"given"); + return 1; + } /* now add the devices */ for ((i=0), (dv = devlist) ; dv ; i++, dv=dv->next) { unsigned long long dsize; -- cgit