master - lvmlockd: do not use an LV lock for some lvchange options
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7f7ec769d98cfe7af47b202189b279f354763b5a Commit: 7f7ec769d98cfe7af47b202189b279f354763b5a Parent: cd369d8a7fc5324f66d9965528ef9b92828b1a19 Author: David Teigland <[email protected]> AuthorDate: Thu May 24 11:41:14 2018 -0500 Committer: David Teigland <[email protected]> CommitterDate: Wed May 30 09:25:45 2018 -0500
lvmlockd: do not use an LV lock for some lvchange options
Some lvchange options can be used even if the LV is active.
--- lib/locking/lvmlockd.c | 5 +++-- tools/lvchange.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-)
lib/locking/lvmlockd.c +3 -2
@@ -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 ;
tools/lvchange.c +5 -3
@@ -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++) {