mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lvmcache: set device in label when switching devs V2
This is an alternative/equivalent to commit ca67cf84df6015c990618de3dc45c0b87eee75ce The problem (wrong label->dev after a new preferred duplicate device is chosen) was isolated to the lvmetad case (non-lvmetad worked fine), and this fixes the problem by setting the new label->dev in the lvmetad-specific code rather than in the general lvmcache code.
This commit is contained in:
parent
ca67cf84df
commit
be23fae488
1
lib/cache/lvmcache.c
vendored
1
lib/cache/lvmcache.c
vendored
@ -1880,7 +1880,6 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,
|
|||||||
info->label->info = info;
|
info->label->info = info;
|
||||||
}
|
}
|
||||||
label = info->label;
|
label = info->label;
|
||||||
label->dev = dev;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
info->fmt = labeller->fmt;
|
info->fmt = labeller->fmt;
|
||||||
|
1
lib/cache/lvmetad.c
vendored
1
lib/cache/lvmetad.c
vendored
@ -372,6 +372,7 @@ static int _pv_populate_lvmcache(struct cmd_context *cmd,
|
|||||||
vgname, (const char *)&vgid, 0))) {
|
vgname, (const char *)&vgid, 0))) {
|
||||||
dev_alternate_cache = dev_alternate;
|
dev_alternate_cache = dev_alternate;
|
||||||
info = info_alternate;
|
info = info_alternate;
|
||||||
|
lvmcache_get_label(info)->dev = dev_alternate;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log_warn("Duplicate of PV %s dev %s exists on unknown device %"PRId64 ":%" PRId64,
|
log_warn("Duplicate of PV %s dev %s exists on unknown device %"PRId64 ":%" PRId64,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user