summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f98d41d)
When performing an "-Ebs -e <metadata type>" we segfault because the
superblock has been freed too early. We also leak memory for 'ddf' and
'imsm' because, unlike super[01], we do not implicitly free when
->load_super is called on an already loaded supertype.
So, fix up imsm and ddf to match type 0 and 1 ->load_super() semantics,
and update Examine to not free the superblock until all usages have been
exhausted.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
ap->st = st;
arrays = ap;
st->ss->getinfo_super(st, &ap->info);
ap->st = st;
arrays = ap;
st->ss->getinfo_super(st, &ap->info);
st->ss->getinfo_super(st, &ap->info);
st->ss->getinfo_super(st, &ap->info);
- st->ss->free_super(st);
- }
if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
ap->spares++;
d = dl_strdup(devlist->devname);
if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
ap->spares++;
d = dl_strdup(devlist->devname);
static int load_super_ddf_all(struct supertype *st, int fd,
void **sbp, char *devname, int keep_fd);
#endif
static int load_super_ddf_all(struct supertype *st, int fd,
void **sbp, char *devname, int keep_fd);
#endif
+
+static void free_super_ddf(struct supertype *st);
+
static int load_super_ddf(struct supertype *st, int fd,
char *devname)
{
static int load_super_ddf(struct supertype *st, int fd,
char *devname)
{
if (posix_memalign((void**)&super, 512, sizeof(*super))!= 0) {
fprintf(stderr, Name ": malloc of %zu failed.\n",
sizeof(*super));
if (posix_memalign((void**)&super, 512, sizeof(*super))!= 0) {
fprintf(stderr, Name ": malloc of %zu failed.\n",
sizeof(*super));
super = alloc_super(0);
if (!super) {
fprintf(stderr,
super = alloc_super(0);
if (!super) {
fprintf(stderr,