summaryrefslogtreecommitdiff
path: root/lib/locking/external_locking.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-02-04 19:18:16 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-02-04 19:18:16 +0000
commitfa6a525c2d50d4f740d25ebac78f94c78618c857 (patch)
treec70d138ec9bd42553464ac687712335c4305c892 /lib/locking/external_locking.c
parentf5f6dcbc623fcef927400b3662b7cf4eb75caf98 (diff)
downloadlvm2-fa6a525c2d50d4f740d25ebac78f94c78618c857.tar.gz
Use cluster-wide message to request device name sync
Thanks to CLVMD_CMD_SYNC_NAMES propagation fix the message passing started to work. So starts to send a message before the VG is unlocked. Removing also implicit sync in VG unlock from clmvd as now the message is delievered and processed in do_command(). Also add support for this new message into external locking and mask this event from further processing.
Diffstat (limited to 'lib/locking/external_locking.c')
-rw-r--r--lib/locking/external_locking.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/locking/external_locking.c b/lib/locking/external_locking.c
index 949d0650a..b7c84095e 100644
--- a/lib/locking/external_locking.c
+++ b/lib/locking/external_locking.c
@@ -18,6 +18,8 @@
#include "defaults.h"
#include "sharedlib.h"
#include "toolcontext.h"
+#include "activate.h"
+#include "locking.h"
static void *_locking_lib = NULL;
static void (*_reset_fn) (void) = NULL;
@@ -31,10 +33,16 @@ static int (*_lock_query_fn) (const char *resource, int *mode) = NULL;
static int _lock_resource(struct cmd_context *cmd, const char *resource,
uint32_t flags)
{
- if (_lock_fn)
- return _lock_fn(cmd, resource, flags);
- else
+ if (!_lock_fn)
return 0;
+
+ if (!strcmp(resource, VG_SYNC_NAMES)) {
+ /* Hide this lock request from external locking */
+ fs_unlock();
+ return 1;
+ }
+
+ return _lock_fn(cmd, resource, flags);
}
static void _fin_external_locking(void)