1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

system_id: detect an lvm1 system id

Detect an lvm1 system id by looking at the WRITE_LOCKED flag.
Don't copy this lvm1 system id into vg->system_id so that the
restrictions associated with the new system id are not applied
to the old VG with the inherited lvm1 system id.
This commit is contained in:
David Teigland 2015-03-09 13:27:34 -05:00
parent 08371a8b80
commit e9a233ee8e

View File

@ -812,6 +812,14 @@ static struct volume_group *_read_vg(struct format_instance *fid,
goto bad; goto bad;
} }
/*
* A system id without WRITE_LOCKED is an old lvm1 system id.
*/
if (!(vg->status & LVM_WRITE_LOCKED) && system_id[0]) {
memcpy(vg->lvm1_system_id, system_id, NAME_LEN + 1);
memset(system_id, 0, NAME_LEN + 1);
}
if (vg->status & LVM_WRITE_LOCKED) { if (vg->status & LVM_WRITE_LOCKED) {
vg->status |= LVM_WRITE; vg->status |= LVM_WRITE;
vg->status &= ~LVM_WRITE_LOCKED; vg->status &= ~LVM_WRITE_LOCKED;