diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-07-31 17:11:41 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-07-31 17:11:41 -0700 |
commit | 37424f132cb3874fe51021b1b5e04445a3ba1bdb (patch) | |
tree | 688e5aa4ce74fb01d4db529c3de46ca8fd9e1ede /Examine.c | |
parent | f98d41ddb4ac543176f33454ceb70983109272d9 (diff) |
fix examine_brief segfault
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>
Diffstat (limited to 'Examine.c')
-rw-r--r-- | Examine.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -114,10 +114,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan, ap->st = st; arrays = ap; st->ss->getinfo_super(st, &ap->info); - } else { + } else 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); |