examine: allows to examine a disk metadata on non-metadata compliant systems
Allow for loading metadata from disk attached to non-metadata compliant system. Affects mdadm --examine and guess_super. Added ignore_hw_compat in supertype to pass information to load_super handler. If ignore_hw_compat is set the handler should load metadata also from disks that do not comply with metadata requirements (i.e. disk is not attached to native controller, etc). Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
246cebdb76
commit
df3346e675
|
@ -87,6 +87,7 @@ int Examine(struct mddev_dev *devlist, int brief, int export, int scan,
|
||||||
st = guess_super(fd);
|
st = guess_super(fd);
|
||||||
if (st) {
|
if (st) {
|
||||||
err = 1;
|
err = 1;
|
||||||
|
st->ignore_hw_compat = 1;
|
||||||
if (!container)
|
if (!container)
|
||||||
err = st->ss->load_super(st, fd,
|
err = st->ss->load_super(st, fd,
|
||||||
(brief||scan) ? NULL
|
(brief||scan) ? NULL
|
||||||
|
@ -98,6 +99,7 @@ int Examine(struct mddev_dev *devlist, int brief, int export, int scan,
|
||||||
if (!err)
|
if (!err)
|
||||||
have_container = 1;
|
have_container = 1;
|
||||||
}
|
}
|
||||||
|
st->ignore_hw_compat = 0;
|
||||||
} else {
|
} else {
|
||||||
if (!brief) {
|
if (!brief) {
|
||||||
fprintf(stderr, Name ": No md superblock detected on %s.\n", devlist->devname);
|
fprintf(stderr, Name ": No md superblock detected on %s.\n", devlist->devname);
|
||||||
|
|
6
mdadm.h
6
mdadm.h
|
@ -827,7 +827,11 @@ struct supertype {
|
||||||
int container_dev; /* devnum of container */
|
int container_dev; /* devnum of container */
|
||||||
void *sb;
|
void *sb;
|
||||||
void *info;
|
void *info;
|
||||||
|
int ignore_hw_compat; /* used to inform metadata handlers that it should ignore
|
||||||
|
HW/firmware related incompatability to load metadata.
|
||||||
|
Used when examining metadata to display content of disk
|
||||||
|
when user has no hw/firmare compatible system.
|
||||||
|
*/
|
||||||
struct metadata_update *updates;
|
struct metadata_update *updates;
|
||||||
struct metadata_update **update_tail;
|
struct metadata_update **update_tail;
|
||||||
|
|
||||||
|
|
3
util.c
3
util.c
|
@ -1196,6 +1196,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
|
||||||
if (guess_type == guess_partitions && ss->add_to_super != NULL)
|
if (guess_type == guess_partitions && ss->add_to_super != NULL)
|
||||||
continue;
|
continue;
|
||||||
memset(st, 0, sizeof(*st));
|
memset(st, 0, sizeof(*st));
|
||||||
|
st->ignore_hw_compat = 1;
|
||||||
rv = ss->load_super(st, fd, NULL);
|
rv = ss->load_super(st, fd, NULL);
|
||||||
if (rv == 0) {
|
if (rv == 0) {
|
||||||
struct mdinfo info;
|
struct mdinfo info;
|
||||||
|
@ -1211,9 +1212,11 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
|
||||||
if (bestsuper != -1) {
|
if (bestsuper != -1) {
|
||||||
int rv;
|
int rv;
|
||||||
memset(st, 0, sizeof(*st));
|
memset(st, 0, sizeof(*st));
|
||||||
|
st->ignore_hw_compat = 1;
|
||||||
rv = superlist[bestsuper]->load_super(st, fd, NULL);
|
rv = superlist[bestsuper]->load_super(st, fd, NULL);
|
||||||
if (rv == 0) {
|
if (rv == 0) {
|
||||||
superlist[bestsuper]->free_super(st);
|
superlist[bestsuper]->free_super(st);
|
||||||
|
st->ignore_hw_compat = 0;
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue