1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

vgchange/lvchange: allow deactivation without locking

If locking with lvmlockd has failed, allow LVs to be deactivated.
This commit is contained in:
David Teigland 2015-07-31 14:11:24 -05:00
parent 649c9d4719
commit 439a579aa2
2 changed files with 7 additions and 3 deletions

View File

@ -1296,7 +1296,9 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
*/
if (arg_count(cmd, activate_ARG) || arg_count(cmd, refresh_ARG)) {
cmd->lockd_vg_default_sh = 1;
cmd->lockd_vg_enforce_sh = 1;
/* Allow deactivating if locks fail. */
if (is_change_activating((activation_change_t)arg_uint_value(cmd, activate_ARG, CHANGE_AY)))
cmd->lockd_vg_enforce_sh = 1;
}
return process_each_lv(cmd, argc, argv,

View File

@ -204,7 +204,7 @@ int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg,
if (vg->system_id && vg->system_id[0] &&
cmd->system_id && cmd->system_id[0] &&
strcmp(vg->system_id, cmd->system_id) &&
is_change_activating(activate)) {
do_activate) {
log_error("Cannot activate LVs in a foreign VG.");
return ECMD_FAILED;
}
@ -1026,7 +1026,9 @@ static int _lockd_vgchange(struct cmd_context *cmd, int argc, char **argv)
if (arg_is_set(cmd, activate_ARG) || arg_is_set(cmd, refresh_ARG)) {
cmd->lockd_vg_default_sh = 1;
cmd->lockd_vg_enforce_sh = 1;
/* Allow deactivating if locks fail. */
if (is_change_activating((activation_change_t)arg_uint_value(cmd, activate_ARG, CHANGE_AY)))
cmd->lockd_vg_enforce_sh = 1;
}
/* Starting a vg lockspace means there are no locks available yet. */