summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9b0502b)
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>
fprintf(stderr, Name ": internal bitmaps not supported by this kernel.\n");
goto abort;
}
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)) {
if (!st->ss->add_internal_bitmap(st, &bitmap_chunk,
delay, write_behind,
bitmapsize, 1, major_num)) {
return 1;
} else if (strcmp(file, "internal") == 0) {
int d;
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;
for (d=0; d< st->max_devs; d++) {
mdu_disk_info_t disk;
char *dv;
if (!st) {
/* just look at device... */
lseek(fd, 0, 0);
if (!st) {
/* just look at device... */
lseek(fd, 0, 0);
+ } else if (!st->ss->locate_bitmap) {
+ fprintf(stderr, Name ": No bitmap possible with %s metadata\n",
+ st->ss->name);
+ return NULL;
+ } else
st->ss->locate_bitmap(st, fd);
st->ss->locate_bitmap(st, fd);
ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
*stp = st;
} else {
ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
*stp = st;
} else {