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:
parent
cd369d8a7f
commit
7f7ec769d9
@ -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;
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user