DDF: fix irregularities with retrieval of 'name' from metadata.
It is only 16 bytes, not 32. And is space padded, not nul terminated. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
9008ed1c96
commit
db42fa9b21
15
super-ddf.c
15
super-ddf.c
|
@ -1300,6 +1300,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info)
|
||||||
struct ddf_super *ddf = st->sb;
|
struct ddf_super *ddf = st->sb;
|
||||||
struct vcl *vc = ddf->currentconf;
|
struct vcl *vc = ddf->currentconf;
|
||||||
int cd = ddf->currentdev;
|
int cd = ddf->currentdev;
|
||||||
|
int j;
|
||||||
|
|
||||||
/* FIXME this returns BVD info - what if we want SVD ?? */
|
/* FIXME this returns BVD info - what if we want SVD ?? */
|
||||||
|
|
||||||
|
@ -1347,7 +1348,11 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info)
|
||||||
st->subarray);
|
st->subarray);
|
||||||
info->safe_mode_delay = 200;
|
info->safe_mode_delay = 200;
|
||||||
|
|
||||||
info->name[0] = 0;
|
memcpy(info->name, ddf->virt->entries[info->container_member].name, 16);
|
||||||
|
info->name[16]=0;
|
||||||
|
for(j=0; j<16; j++)
|
||||||
|
if (info->name[j] == ' ')
|
||||||
|
info->name[j] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2661,6 +2666,7 @@ static struct mdinfo *container_content_ddf(struct supertype *st)
|
||||||
for (vc = ddf->conflist ; vc ; vc=vc->next)
|
for (vc = ddf->conflist ; vc ; vc=vc->next)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
int j;
|
||||||
struct mdinfo *this;
|
struct mdinfo *this;
|
||||||
this = malloc(sizeof(*this));
|
this = malloc(sizeof(*this));
|
||||||
memset(this, 0, sizeof(*this));
|
memset(this, 0, sizeof(*this));
|
||||||
|
@ -2691,8 +2697,11 @@ static struct mdinfo *container_content_ddf(struct supertype *st)
|
||||||
this->array.state = 1;
|
this->array.state = 1;
|
||||||
this->resync_start = ~0ULL;
|
this->resync_start = ~0ULL;
|
||||||
}
|
}
|
||||||
memcpy(this->name, ddf->virt->entries[i].name, 32);
|
memcpy(this->name, ddf->virt->entries[i].name, 16);
|
||||||
this->name[32]=0;
|
this->name[16]=0;
|
||||||
|
for(j=0; j<16; j++)
|
||||||
|
if (this->name[j] == ' ')
|
||||||
|
this->name[j] = 0;
|
||||||
|
|
||||||
memset(this->uuid, 0, sizeof(this->uuid));
|
memset(this->uuid, 0, sizeof(this->uuid));
|
||||||
this->component_size = __be64_to_cpu(vc->conf.blocks);
|
this->component_size = __be64_to_cpu(vc->conf.blocks);
|
||||||
|
|
Loading…
Reference in New Issue