1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Locking P_global causes a cache refresh.

This commit is contained in:
Patrick Caulfield 2007-08-23 15:43:20 +00:00
parent da27380ab5
commit 4cd97611e5
2 changed files with 13 additions and 5 deletions

View File

@ -115,8 +115,13 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
break;
case CLVMD_CMD_LOCK_VG:
lockname = &args[2];
/* Check to see if the VG is in use by LVM1 */
status = do_check_lvm1(&args[2]);
status = do_check_lvm1(lockname);
/* P_global causes a cache refresh */
if (strcmp(lockname, "P_global") == 0)
do_refresh_cache();
break;
case CLVMD_CMD_LOCK_LV:

View File

@ -330,11 +330,14 @@ static int _lock_for_cluster(unsigned char cmd, uint32_t flags, char *name)
* locks are cluster-wide.
* Also, if the lock is exclusive it makes no sense to try to
* acquire it on all nodes, so just do that on the local node too.
* One exception, is that P_ locks /do/ get distributed across
* the cluster because they might have side-effects.
*/
if (cmd == CLVMD_CMD_LOCK_VG ||
(flags & LCK_TYPE_MASK) == LCK_EXCL ||
(flags & LCK_LOCAL) ||
!(flags & LCK_CLUSTER_VG))
if (strncmp(name, "P_", 2) &&
(cmd == CLVMD_CMD_LOCK_VG ||
(flags & LCK_TYPE_MASK) == LCK_EXCL ||
(flags & LCK_LOCAL) ||
!(flags & LCK_CLUSTER_VG)))
node = ".";
status = _cluster_request(cmd, node, args, len,