summaryrefslogtreecommitdiff
path: root/tools/lvchange.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lvchange.c')
-rw-r--r--tools/lvchange.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 5f0f9c512..ee54e5aa7 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1171,6 +1171,14 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
}
}
+ /*
+ * The default vg lock mode for lvchange is ex, but these options
+ * are cases where lvchange does not modify the vg, so they can use
+ * the sh lock mode.
+ */
+ if (arg_count(cmd, activate_ARG) || arg_count(cmd, refresh_ARG))
+ cmd->command->flags |= DLOCK_VG_SH;
+
if (arg_tag_count(argc, argv) && !dlock_gl(cmd, "sh", 0))
return_ECMD_FAILED;