summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WHATS_NEW1
-rw-r--r--daemons/clvmd/clvmd-command.c1
-rw-r--r--lib/locking/external_locking.c14
-rw-r--r--lib/locking/file_locking.c1
-rw-r--r--lib/locking/locking.h9
5 files changed, 20 insertions, 6 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index d898c64b..7e06bfa9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.83 -
===================================
+ Use cluster-wide message to request device name sync.
Fix operation node stacking for consecutive dm ops.
Increase hash table size to 1024 lv names and 64 pv uuids.
Remove fs_unlock() from lv_resume path.
diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c
index 38727021..6d0dee4a 100644
--- a/daemons/clvmd/clvmd-command.c
+++ b/daemons/clvmd/clvmd-command.c
@@ -217,7 +217,6 @@ static int lock_vg(struct local_client *client)
if (lkid == 0)
return EINVAL;
- lvm_do_fs_unlock(); /* Wait for devices */
status = sync_unlock(lockname, lkid);
if (status)
status = errno;
diff --git a/lib/locking/external_locking.c b/lib/locking/external_locking.c
index 949d0650..b7c84095 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)
diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c
index 0c8bbed4..68b0420b 100644
--- a/lib/locking/file_locking.c
+++ b/lib/locking/file_locking.c
@@ -215,7 +215,6 @@ static int _lock_file(const char *file, uint32_t flags)
state = 'W';
break;
case LCK_UNLOCK:
- fs_unlock(); /* Wait until devices are available */
return _release_lock(file, 1);
default:
log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
diff --git a/lib/locking/locking.h b/lib/locking/locking.h
index 1b5e1fc0..51a7198c 100644
--- a/lib/locking/locking.h
+++ b/lib/locking/locking.h
@@ -143,7 +143,12 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv)) : \
0)
-#define unlock_vg(cmd, vol) lock_vol(cmd, vol, LCK_VG_UNLOCK)
+#define unlock_vg(cmd, vol) \
+ do { \
+ if (is_real_vg(vol)) \
+ sync_dev_names(cmd); \
+ lock_vol(cmd, vol, LCK_VG_UNLOCK); \
+ } while (0)
#define unlock_and_free_vg(cmd, vg, vol) \
do { \
unlock_vg(cmd, vol); \
@@ -172,6 +177,8 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
lock_vol((vg)->cmd, (vg)->name, LCK_VG_BACKUP)
#define sync_local_dev_names(cmd) \
lock_vol(cmd, VG_SYNC_NAMES, LCK_NONE | LCK_CACHE | LCK_LOCAL)
+#define sync_dev_names(cmd) \
+ lock_vol(cmd, VG_SYNC_NAMES, LCK_NONE | LCK_CACHE)
/* Process list of LVs */
int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs);