1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix activation logic in lvchange --persistent.

This commit is contained in:
Alasdair Kergon 2006-07-10 19:39:14 +00:00
parent fe686a5180
commit 443a8f76c6
2 changed files with 9 additions and 19 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.07 -
=================================
Fix activation logic in lvchange --persistent.
Don't ignore persistent minor numbers when activating.
Use RTLD_GLOBAL when loading shared libraries.
Add some forgotten memlock checks to _vg_read to protect against full scans.

View File

@ -315,14 +315,7 @@ static int lvchange_persistent(struct cmd_context *cmd,
lv->major = arg_int_value(cmd, major_ARG, lv->major);
log_verbose("Setting persistent device number to (%d, %d) "
"for \"%s\"", lv->major, lv->minor, lv->name);
if (active) {
log_verbose("Re-activating logical volume \"%s\"",
lv->name);
if (!activate_lv(cmd, lv)) {
log_error("%s: reactivation failed", lv->name);
return 0;
}
}
}
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
@ -333,22 +326,18 @@ static int lvchange_persistent(struct cmd_context *cmd,
backup(lv->vg);
if (!suspend_lv(cmd, lv)) {
log_error("Failed to lock %s", lv->name);
vg_revert(lv->vg);
return 0;
}
if (!vg_commit(lv->vg)) {
resume_lv(cmd, lv);
stack;
return 0;
}
log_very_verbose("Updating permissions for \"%s\" in kernel", lv->name);
if (!resume_lv(cmd, lv)) {
log_error("Problem reactivating %s", lv->name);
if (active) {
log_verbose("Re-activating logical volume \"%s\"", lv->name);
if (!activate_lv(cmd, lv)) {
log_error("%s: reactivation failed", lv->name);
return 0;
}
}
return 1;
}