diff --git a/WHATS_NEW b/WHATS_NEW index 84f0f20d9..0aea83918 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.07 - ================================= + Add some forgotten memlock checks to _vg_read to protect against full scans. Add mutex to dmeventd_mirror to avoid concurrent execution. Fix vgreduce --removemissing to return success if VG is already consistent. Fix return code if VG specified on command line is not found. diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 295ac0137..76bbad019 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -993,7 +993,11 @@ static struct volume_group *_vg_read(struct cmd_context *cmd, if (list_size(&correct_vg->pvs) != list_size(pvids)) { log_debug("Cached VG %s had incorrect PV list", vg->name); - correct_vg = NULL; + + if (memlock()) + inconsistent = 1; + else + correct_vg = NULL; } else list_iterate_items(pvl, &correct_vg->pvs) { if (!str_list_match_item(pvids, pvl->pv->dev->pvid)) { log_debug("Cached VG %s had incorrect PV list", @@ -1008,6 +1012,10 @@ static struct volume_group *_vg_read(struct cmd_context *cmd, if (!correct_vg) { inconsistent = 0; + if (memlock()) { + stack; + return NULL; + } lvmcache_label_scan(cmd, 2); if (!(fmt = fmt_from_vgname(vgname, vgid))) { stack; @@ -1149,7 +1157,8 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd, if (!consistent) { log_error("Volume group %s metadata is " "inconsistent", vginfo->vgname); - return NULL; + if (!partial_mode()) + return NULL; } return vg; }