1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +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) { if (result == -EEXIST) {
/* /*
* This happens if lvchange tries to modify the LV with an ex * This happens if a command like lvchange tries to modify the
* LV lock when the LV is already active with a sh LV lock. * 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); log_error("LV is already locked with incompatible mode: %s/%s", vg->name, lv_name);
return 0; return 0;

View File

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