From 12e36e7ea74c1de020d345ed081791791e3e4ec8 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 2 Feb 2011 23:39:39 +0000 Subject: [PATCH] Allow CLVMD_CMD_SYNC_NAMES to be propagated around the cluster if requested. --- WHATS_NEW | 1 + lib/locking/cluster_locking.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 106f2d4a0..18c90febb 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.83 - =================================== + Allow CLVMD_CMD_SYNC_NAMES to be propagated around the cluster if requested. Add "dmsetup ls --tree" output to lvmdump. Fix udev synchronization with no-locking --sysinit (2.02.80). Updating man pages for pvcreate, pvremove, pvresize, pvscan. diff --git a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c index 83b1cd20d..c9f8fbe35 100644 --- a/lib/locking/cluster_locking.c +++ b/lib/locking/cluster_locking.c @@ -347,13 +347,17 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd, * One exception, is that P_ locks (except VG_SYNC_NAMES) /do/ get * distributed across the cluster because they might have side-effects. */ - if ((strncmp(name, "P_", 2) && - (clvmd_cmd == CLVMD_CMD_LOCK_VG || - (flags & LCK_TYPE_MASK) == LCK_EXCL || - (flags & LCK_LOCAL) || - !(flags & LCK_CLUSTER_VG))) || - (clvmd_cmd == CLVMD_CMD_SYNC_NAMES && (flags & LCK_LOCAL))) - node = "."; + if (clvmd_cmd == CLVMD_CMD_SYNC_NAMES) { + if (flags & LCK_LOCAL) + node = "."; + } else if (clvmd_cmd != CLVMD_CMD_VG_BACKUP) { + if (strncmp(name, "P_", 2) && + (clvmd_cmd == CLVMD_CMD_LOCK_VG || + (flags & LCK_TYPE_MASK) == LCK_EXCL || + (flags & LCK_LOCAL) || + !(flags & LCK_CLUSTER_VG))) + node = "."; + } status = _cluster_request(clvmd_cmd, node, args, len, &response, &num_responses);