summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-24 11:57:42 +1100
committerNeilBrown <neilb@suse.de>2010-04-07 09:18:01 +1000
commitebeb36638225e86826052400c1c538857bc7c461 (patch)
treed13ddb6bab316f6c971c295f7f003cb04a45bff9 /Grow.c
parent9b0502b879dc6308428bc2bce4f8e1b56fc93f6c (diff)
downloadmdadm-ebeb36638225e86826052400c1c538857bc7c461.tar.gz
mdadm-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 'Grow.c')
-rw-r--r--Grow.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index 6264996..053a372 100644
--- a/Grow.c
+++ b/Grow.c
@@ -288,6 +288,11 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
return 1;
} else if (strcmp(file, "internal") == 0) {
int d;
+ if (st->ss->add_internal_bitmap == NULL) {
+ fprintf(stderr, Name ": Internal bitmaps not supported "
+ "with %s metadata\n", st->ss->name);
+ return 1;
+ }
for (d=0; d< st->max_devs; d++) {
mdu_disk_info_t disk;
char *dv;