Reported-by: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
fd2 = dev_open(dv, O_RDWR);
if (fd2 < 0)
continue;
- if (st->ss->load_super(st, fd2, NULL)==0) {
+ rv = st->ss->load_super(st, fd2, NULL);
+ if (!rv) {
if (st->ss->add_internal_bitmap(
st, &s->bitmap_chunk, c->delay,
s->write_behind, bitmapsize,
close(fd2);
return 1;
}
+ } else {
+ pr_err("failed to load super-block.\n");
+ close(fd2);
+ return 1;
}
close(fd2);
}