All of lore.kernel.org
 help / color / mirror / Atom feed
From: mbroz@sourceware.org <mbroz@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/locking/locking.c
Date: 31 Mar 2010 17:23:57 -0000	[thread overview]
Message-ID: <20100331172357.1067.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz at sourceware.org	2010-03-31 17:23:57

Modified files:
	.              : WHATS_NEW 
	lib/locking    : locking.c 

Log message:
	Always use blocking lock for VGs and orphan locks.
	
	Because we have now strong rule for lock ordering:
	- VG locks must be taken in alphabetical order
	- ORPHAN locks must be the last
	vgs_locked() is now not needed.
	
	This fixes problem with orphan locking, e.g.
	vgremove VG1    |    vgremove VG2
	lock(VG1)       |    lock(VG2)
	lock(ORPHAN)    |    lock(ORPHAN) -> fail, non-blocking
	
	https://bugzilla.redhat.com/show_bug.cgi?id=578413
	
	(More similar places in code.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1497&r2=1.1498
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

--- LVM2/WHATS_NEW	2010/03/31 17:23:18	1.1497
+++ LVM2/WHATS_NEW	2010/03/31 17:23:56	1.1498
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Always use blocking lock for VGs and orphan locks.
   Allocate all segments memory from vg private mempool.
   Return newly allocated PV segment after segment split.
   Optimise PV segments search for the most last segment search case.
--- LVM2/lib/locking/locking.c	2010/03/05 14:48:34	1.75
+++ LVM2/lib/locking/locking.c	2010/03/31 17:23:57	1.76
@@ -420,11 +420,9 @@
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
 		/*
-		 * Automatically set LCK_NONBLOCK if one or more VGs locked.
-		 * This will enforce correctness and prevent deadlocks rather
-		 * than relying on the caller to set the flag properly.
+		 * VG locks alphabetical, ORPHAN lock last
 		 */
-		if (!_blocking_supported || vgs_locked())
+		if (!_blocking_supported)
 			flags |= LCK_NONBLOCK;
 
 		if (vol[0] != '#' &&



             reply	other threads:[~2010-03-31 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 17:23 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27 15:53 LVM2 ./WHATS_NEW lib/locking/locking.c mbroz
2011-08-10 16:07 mbroz
2011-01-13 14:56 zkabelac
2010-01-13 17:40 mbroz
2009-11-23 10:55 mbroz
2009-07-14 11:01 agk
2009-02-22 16:13 agk
2008-05-08 18:35 agk
2006-10-14 16:37 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100331172357.1067.qmail@sourceware.org \
    --to=mbroz@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.