From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11780 invoked by alias); 30 Jan 2008 16:18:39 -0000 Received: (qmail 11766 invoked by uid 9447); 30 Jan 2008 16:18:39 -0000 Date: Wed, 30 Jan 2008 16:18:00 -0000 Message-ID: <20080130161839.11764.qmail@sourceware.org> From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/cache lvmcache.c 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: 2008-01/txt/msg00081.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-01-30 16:18:38 Modified files: lib/cache : lvmcache.c Log message: only read labels once between each lock event Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37 --- LVM2/lib/cache/lvmcache.c 2008/01/30 13:59:58 1.36 +++ LVM2/lib/cache/lvmcache.c 2008/01/30 16:18:37 1.37 @@ -225,6 +225,16 @@ if (info->status & CACHE_INVALID) return 0; + /* + * The caller must hold the VG lock to manipulate metadata. + * In a cluster, remote nodes sometimes read metadata in the + * knowledge that the controlling node is holding the lock. + * So if the VG appears to be unlocked here, it should be safe + * to use the cached value. + */ + if (info->vginfo && !vgname_is_locked(info->vginfo->vgname)) + return 1; + if (!(info->status & CACHE_LOCKED)) return 0;