1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2011-02-04 19:18:16 +00:00
parent f5f6dcbc62
commit fa6a525c2d
5 changed files with 20 additions and 6 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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)

View File

@ -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);

View File

@ -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);