mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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:
parent
08371a8b80
commit
e9a233ee8e
@ -812,6 +812,14 @@ static struct volume_group *_read_vg(struct format_instance *fid,
|
||||
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) {
|
||||
vg->status |= LVM_WRITE;
|
||||
vg->status &= ~LVM_WRITE_LOCKED;
|
||||
|
Loading…
Reference in New Issue
Block a user