1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +03:00

Add some forgotten memlock checks to _vg_read to protect against full scans.

This commit is contained in:
Alasdair Kergon 2006-07-04 19:36:49 +00:00
parent f1dc5cc99b
commit e67ed94b3e
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.07 - 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. Add mutex to dmeventd_mirror to avoid concurrent execution.
Fix vgreduce --removemissing to return success if VG is already consistent. Fix vgreduce --removemissing to return success if VG is already consistent.
Fix return code if VG specified on command line is not found. Fix return code if VG specified on command line is not found.

View File

@ -993,6 +993,10 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
if (list_size(&correct_vg->pvs) != list_size(pvids)) { if (list_size(&correct_vg->pvs) != list_size(pvids)) {
log_debug("Cached VG %s had incorrect PV list", log_debug("Cached VG %s had incorrect PV list",
vg->name); vg->name);
if (memlock())
inconsistent = 1;
else
correct_vg = NULL; correct_vg = NULL;
} else list_iterate_items(pvl, &correct_vg->pvs) { } else list_iterate_items(pvl, &correct_vg->pvs) {
if (!str_list_match_item(pvids, pvl->pv->dev->pvid)) { if (!str_list_match_item(pvids, pvl->pv->dev->pvid)) {
@ -1008,6 +1012,10 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
if (!correct_vg) { if (!correct_vg) {
inconsistent = 0; inconsistent = 0;
if (memlock()) {
stack;
return NULL;
}
lvmcache_label_scan(cmd, 2); lvmcache_label_scan(cmd, 2);
if (!(fmt = fmt_from_vgname(vgname, vgid))) { if (!(fmt = fmt_from_vgname(vgname, vgid))) {
stack; stack;
@ -1149,6 +1157,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
if (!consistent) { if (!consistent) {
log_error("Volume group %s metadata is " log_error("Volume group %s metadata is "
"inconsistent", vginfo->vgname); "inconsistent", vginfo->vgname);
if (!partial_mode())
return NULL; return NULL;
} }
return vg; return vg;