From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5527 invoked by alias); 23 Aug 2007 15:43:21 -0000 Received: (qmail 5475 invoked by uid 9452); 23 Aug 2007 15:43:20 -0000 Date: Thu, 23 Aug 2007 15:43:00 -0000 Message-ID: <20070823154320.5472.qmail@sourceware.org> From: pcaulfield@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 lib/locking/cluster_locking.c daemons/clv ... Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00035.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: pcaulfield@sourceware.org 2007-08-23 15:43:20 Modified files: lib/locking : cluster_locking.c daemons/clvmd : clvmd-command.c Log message: Locking P_global causes a cache refresh. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 --- LVM2/lib/locking/cluster_locking.c 2007/08/23 15:02:26 1.20 +++ LVM2/lib/locking/cluster_locking.c 2007/08/23 15:43:19 1.21 @@ -330,11 +330,14 @@ * 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, --- LVM2/daemons/clvmd/clvmd-command.c 2007/08/17 11:51:23 1.17 +++ LVM2/daemons/clvmd/clvmd-command.c 2007/08/23 15:43:20 1.18 @@ -115,8 +115,13 @@ 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: