diff options
author | David Teigland <teigland@redhat.com> | 2018-06-07 15:33:02 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2018-06-07 16:47:15 -0500 |
commit | e6bb780d24246666fa05948ec449a8137280b443 (patch) | |
tree | 20631b44553328e891a4c660ac21077ffdcf11b5 /lib/misc | |
parent | c7c7017f0c12ebab4e1aef9d9a9fabd4ec2adfe3 (diff) | |
download | lvm2-e6bb780d24246666fa05948ec449a8137280b443.tar.gz |
Rework lock-override options and locking_type settings
The last commit related to this was incomplete:
"Implement lock-override options without locking type"
This is further reworking and reduction of the locking.[ch]
layer which handled all clustering, but is now only used
for file locking. The "locking types" that this layer
implemented were removed previously, leaving only the
standard file locking. (Some cluster-related artifacts
remain to be cleared out later.)
Command options to override or modify locking behavior
are reimplemented here without using the locking types.
Also, deprecated locking_type values are recognized,
and implemented as if one of the equivalent override
options was set.
Options that override file locking are:
. --nolocking disables all file locking.
. --readonly grants read lock requests without actually
taking a file lock, and refuses write lock requests.
. --ignorelockingfailure tries to set up file locks and
uses them normally if possible. When not possible, it
behaves like --readonly, but allows activation.
. --sysinit is the same as ignorelockingfailure.
. global/metadata_read_only acquires actual read file
locks, and refuses write lock requests.
(Some of these options could probably be deprecated
because they were added as workarounds to various
locking_type behaviors that are now deprecated.)
The locking_type setting now has one valid value: 1 which
refers to standard file locking. Configs that contain
deprecated values are recognized and still work in
largely the same way:
. 0 disabled all locking, now implemented like --nolocking
is set. Allow the nolocking option in all commands.
. 1 is the normal file locking setting and is unchanged.
. 2 was for external locking which was not used, and
reverts to normal file locking.
. 3 was for cluster/clvm. This reverts to normal file
locking, and prints messages about lvmlockd.
. 4 was equivalent to readonly, now implemented like
--readonly is set.
. 5 disabled all locking, now implemented like
--nolocking is set.
Diffstat (limited to 'lib/misc')
-rw-r--r-- | lib/misc/lvm-globals.c | 11 | ||||
-rw-r--r-- | lib/misc/lvm-globals.h | 4 | ||||
-rw-r--r-- | lib/misc/sharedlib.c | 2 |
3 files changed, 1 insertions, 16 deletions
diff --git a/lib/misc/lvm-globals.c b/lib/misc/lvm-globals.c index b76ddb9c4..937758841 100644 --- a/lib/misc/lvm-globals.c +++ b/lib/misc/lvm-globals.c @@ -34,7 +34,6 @@ static int _trust_cache = 0; /* Don't scan when incomplete VGs encountered */ static int _debug_level = 0; static int _debug_classes_logged = 0; static int _log_cmd_name = 0; -static int _ignorelockingfailure = 0; static int _security_level = SECURITY_LEVEL; static char _cmd_name[30] = ""; static int _mirror_in_sync = 0; @@ -106,11 +105,6 @@ void init_trust_cache(int trustcache) _trust_cache = trustcache; } -void init_ignorelockingfailure(int level) -{ - _ignorelockingfailure = level; -} - void init_security_level(int level) { _security_level = level; @@ -267,11 +261,6 @@ int background_polling(void) return _background_polling; } -int ignorelockingfailure(void) -{ - return _ignorelockingfailure; -} - int security_level(void) { return _security_level; diff --git a/lib/misc/lvm-globals.h b/lib/misc/lvm-globals.h index b3838911f..55a9399c6 100644 --- a/lib/misc/lvm-globals.h +++ b/lib/misc/lvm-globals.h @@ -35,8 +35,6 @@ void init_trust_cache(int trustcache); void init_debug(int level); void init_debug_classes_logged(int classes); void init_cmd_name(int status); -void init_ignorelockingfailure(int level); -void init_lockingfailed(int level); void init_security_level(int level); void init_mirror_in_sync(int in_sync); void init_dmeventd_monitor(int reg); @@ -69,8 +67,6 @@ int verbose_level(void); int silent_mode(void); int debug_level(void); int debug_class_is_logged(int class); -int ignorelockingfailure(void); -int lockingfailed(void); int security_level(void); int mirror_in_sync(void); int background_polling(void); diff --git a/lib/misc/sharedlib.c b/lib/misc/sharedlib.c index d59447012..4c2d5d9b3 100644 --- a/lib/misc/sharedlib.c +++ b/lib/misc/sharedlib.c @@ -58,7 +58,7 @@ void *load_shared_library(struct cmd_context *cmd, const char *libname, log_very_verbose("Opening shared %s library %s", desc, path); if (!(library = dlopen(path, RTLD_LAZY | RTLD_GLOBAL))) { - if (silent && ignorelockingfailure()) + if (silent) log_verbose("Unable to open external %s library %s: %s", desc, path, dlerror()); else |