From 3a4fe54ca12daf0af142e47092968cadb279d10b Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 23 May 2018 10:15:39 -0500 Subject: [PATCH] config: revert to normal locking when no cluster and suggest lvmlockd --- lib/locking/locking.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/locking/locking.c b/lib/locking/locking.c index 105419af4..258422708 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -148,11 +148,11 @@ int init_locking(int type, struct cmd_context *cmd, int suppress_messages) } #endif -#ifdef CLUSTER_LOCKING_INTERNAL log_very_verbose("Falling back to internal clustered locking."); /* Fall through */ case 3: +#ifdef CLUSTER_LOCKING_INTERNAL log_very_verbose("Cluster locking selected."); if (!init_cluster_locking(&_locking, cmd, suppress_messages)) { log_error_suppress(suppress_messages, @@ -160,6 +160,20 @@ int init_locking(int type, struct cmd_context *cmd, int suppress_messages) break; } return 1; +#else + log_warn("WARNING: Using locking_type=1, ignoring locking_type=3."); + log_warn("WARNING: See lvmlockd(8) for information on using cluster/clvm VGs."); + type = 1; + + log_very_verbose("%sFile-based locking selected.", + _blocking_supported ? "" : "Non-blocking "); + + if (!init_file_locking(&_locking, cmd, suppress_messages)) { + log_error_suppress(suppress_messages, + "File-based locking initialisation failed."); + break; + } + return 1; #endif case 4: