summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-24 01:57:42 +0100
committerNeilBrown <neilb@suse.de>2010-04-07 01:18:01 +0200
commitebeb36638225e86826052400c1c538857bc7c461 (patch)
treed13ddb6bab316f6c971c295f7f003cb04a45bff9 /Create.c
parentMerge branch 'HEAD'; commit 'a4b93c9ce4f15217afb8' (diff)
downloadmdadm-ebeb36638225e86826052400c1c538857bc7c461.tar.xz
mdadm-ebeb36638225e86826052400c1c538857bc7c461.zip
Don't attempt to create or read bitmaps where the metadata doesn't support it.
In particular, if the relevant bitmap method is NULL, don't try to call it, print an error instead. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Create.c b/Create.c
index 909ac5da..8f6e6e70 100644
--- a/Create.c
+++ b/Create.c
@@ -651,6 +651,11 @@ int Create(struct supertype *st, char *mddev,
fprintf(stderr, Name ": internal bitmaps not supported by this kernel.\n");
goto abort;
}
+ if (!st->ss->add_internal_bitmap) {
+ fprintf(stderr, Name ": internal bitmaps not supported with %s metadata\n",
+ st->ss->name);
+ goto abort;
+ }
if (!st->ss->add_internal_bitmap(st, &bitmap_chunk,
delay, write_behind,
bitmapsize, 1, major_num)) {