mirror of
https://github.com/systemd/systemd.git
synced 2024-10-29 04:55:36 +03:00
volume_id: old md metadata has only 32 bit for the uuid
This commit is contained in:
parent
900878ac80
commit
e18e6d7999
@ -78,9 +78,15 @@ static int volume_id_probe_linux_raid0(struct volume_id *id, uint64_t off, uint6
|
|||||||
|
|
||||||
if (le32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
|
if (le32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
|
||||||
uuid.ints[0] = bswap_32(mdp0->set_uuid0);
|
uuid.ints[0] = bswap_32(mdp0->set_uuid0);
|
||||||
uuid.ints[1] = bswap_32(mdp0->set_uuid1);
|
if (le32_to_cpu(mdp0->minor_version >= 90)) {
|
||||||
uuid.ints[2] = bswap_32(mdp0->set_uuid2);
|
uuid.ints[1] = bswap_32(mdp0->set_uuid1);
|
||||||
uuid.ints[3] = bswap_32(mdp0->set_uuid3);
|
uuid.ints[2] = bswap_32(mdp0->set_uuid2);
|
||||||
|
uuid.ints[3] = bswap_32(mdp0->set_uuid3);
|
||||||
|
} else {
|
||||||
|
uuid.ints[1] = 0;
|
||||||
|
uuid.ints[2] = 0;
|
||||||
|
uuid.ints[3] = 0;
|
||||||
|
}
|
||||||
volume_id_set_uuid(id, uuid.bytes, UUID_DCE);
|
volume_id_set_uuid(id, uuid.bytes, UUID_DCE);
|
||||||
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
|
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
|
||||||
le32_to_cpu(mdp0->major_version),
|
le32_to_cpu(mdp0->major_version),
|
||||||
@ -88,9 +94,15 @@ static int volume_id_probe_linux_raid0(struct volume_id *id, uint64_t off, uint6
|
|||||||
le32_to_cpu(mdp0->patch_version));
|
le32_to_cpu(mdp0->patch_version));
|
||||||
} else if (be32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
|
} else if (be32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
|
||||||
uuid.ints[0] = mdp0->set_uuid0;
|
uuid.ints[0] = mdp0->set_uuid0;
|
||||||
uuid.ints[1] = mdp0->set_uuid1;
|
if (be32_to_cpu(mdp0->minor_version >= 90)) {
|
||||||
uuid.ints[2] = mdp0->set_uuid2;
|
uuid.ints[1] = mdp0->set_uuid1;
|
||||||
uuid.ints[3] = mdp0->set_uuid3;
|
uuid.ints[2] = mdp0->set_uuid2;
|
||||||
|
uuid.ints[3] = mdp0->set_uuid3;
|
||||||
|
} else {
|
||||||
|
uuid.ints[1] = 0;
|
||||||
|
uuid.ints[2] = 0;
|
||||||
|
uuid.ints[3] = 0;
|
||||||
|
}
|
||||||
volume_id_set_uuid(id, uuid.bytes, UUID_DCE);
|
volume_id_set_uuid(id, uuid.bytes, UUID_DCE);
|
||||||
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
|
snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
|
||||||
be32_to_cpu(mdp0->major_version),
|
be32_to_cpu(mdp0->major_version),
|
||||||
|
Loading…
Reference in New Issue
Block a user