From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4566 invoked by alias); 8 May 2008 18:35:59 -0000 Received: (qmail 4543 invoked by uid 9447); 8 May 2008 18:35:59 -0000 Date: Thu, 08 May 2008 18:35:00 -0000 Message-ID: <20080508183559.4540.qmail@sourceware.org> From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/locking/locking.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-05/txt/msg00003.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-05-08 18:35:58 Modified files: . : WHATS_NEW lib/locking : locking.c Log message: Avoid unnecessary unlock attempts with LCK_CACHE pseudo-locks. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.869&r2=1.870 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48 --- LVM2/WHATS_NEW 2008/05/08 18:28:27 1.869 +++ LVM2/WHATS_NEW 2008/05/08 18:35:58 1.870 @@ -5,6 +5,7 @@ Version 2.02.37 - ================================= + Avoid unnecessary unlock attempts with LCK_CACHE pseudo-locks. When asked to drop cached committed VG metadata, invalidate cached PV labels. Drop metadata cache before writing precommitted metadata instead of after. Don't touch /dev in vgrename if activation is disabled. --- LVM2/lib/locking/locking.c 2008/04/15 14:46:19 1.47 +++ LVM2/lib/locking/locking.c 2008/05/08 18:35:58 1.48 @@ -370,8 +370,12 @@ if (!_lock_vol(cmd, resource, flags)) return 0; - /* Perform immediate unlock unless LCK_HOLD set */ - if (!(flags & LCK_HOLD) && ((flags & LCK_TYPE_MASK) != LCK_UNLOCK)) { + /* + * If a real lock was acquired (i.e. not LCK_CACHE), + * perform an immediate unlock unless LCK_HOLD was requested. + */ + if (!(flags & LCK_CACHE) && !(flags & LCK_HOLD) && + ((flags & LCK_TYPE_MASK) != LCK_UNLOCK)) { if (!_lock_vol(cmd, resource, (flags & ~LCK_TYPE_MASK) | LCK_UNLOCK)) return 0;