Detail.c: call load_container for container subarrays
Without calling load_container at this point, the info structure may be missing some important information. In particular, information about secondary DDF RAID levels may be wrong if information is only read from a single disk. If this fails, fall back to the previous code. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
4eefd651f0
commit
c1ea5a9809
10
Detail.c
10
Detail.c
|
@ -103,14 +103,22 @@ int Detail(char *dev, struct context *c)
|
||||||
* We want the name of the container, and the member
|
* We want the name of the container, and the member
|
||||||
*/
|
*/
|
||||||
int devid = devnm2devid(st->container_devnm);
|
int devid = devnm2devid(st->container_devnm);
|
||||||
|
int cfd, err;
|
||||||
|
|
||||||
member = subarray;
|
member = subarray;
|
||||||
container = map_dev_preferred(major(devid), minor(devid),
|
container = map_dev_preferred(major(devid), minor(devid),
|
||||||
1, c->prefer);
|
1, c->prefer);
|
||||||
|
cfd = open_dev(st->container_devnm);
|
||||||
|
if (cfd >= 0) {
|
||||||
|
err = st->ss->load_container(st, cfd, NULL);
|
||||||
|
close(cfd);
|
||||||
|
if (err == 0)
|
||||||
|
info = st->ss->container_content(st, subarray);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to load a superblock */
|
/* try to load a superblock */
|
||||||
if (st) for (d = 0; d < max_disks; d++) {
|
if (st && !info) for (d = 0; d < max_disks; d++) {
|
||||||
mdu_disk_info_t disk;
|
mdu_disk_info_t disk;
|
||||||
char *dv;
|
char *dv;
|
||||||
int fd2;
|
int fd2;
|
||||||
|
|
Loading…
Reference in New Issue