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

lvmlockd: do not use an LV lock for some lvchange options

Some lvchange options can be used even if the LV is active.
This commit is contained in:
David Teigland 2018-05-24 11:41:14 -05:00
parent cd369d8a7f
commit 7f7ec769d9
2 changed files with 8 additions and 5 deletions

View File

@ -2105,8 +2105,9 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
if (result == -EEXIST) {
/*
* This happens if lvchange tries to modify the LV with an ex
* LV lock when the LV is already active with a sh LV lock.
* This happens if a command like lvchange tries to modify the
* LV with an ex LV lock when the LV is already active with a
* sh LV lock.
*/
log_error("LV is already locked with incompatible mode: %s/%s", vg->name, lv_name);
return 0;

View File

@ -1056,9 +1056,11 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
int i, opt_enum;
uint32_t mr = 0;
/* If LV is inactive here, ensure it's not active elsewhere. */
if (!lockd_lv(cmd, lv, "ex", 0))
return_ECMD_FAILED;
/*
* We do not acquire an lvmlockd lock on the LV here because these are
* VG metadata changes that do not conflict with the LV being active on
* another host.
*/
/* First group of options which allow for one metadata commit/update for the whole group */
for (i = 0; i < cmd->command->ro_count; i++) {