]> sourceware.org Git - lvm2.git/commitdiff
Always use blocking lock for VGs and orphan locks.
authorMilan Broz <mbroz@redhat.com>
Wed, 31 Mar 2010 17:23:56 +0000 (17:23 +0000)
committerMilan Broz <mbroz@redhat.com>
Wed, 31 Mar 2010 17:23:56 +0000 (17:23 +0000)
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.)

WHATS_NEW
lib/locking/locking.c

index 3b0ac1f203eefe0591e1cdb9aeb3ee15c8041ccb..29a6f4a87568d971011635d89aa5b94ff3dec7ac 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index 76dbda53d243006f707eba6e10b1ae9200138be7..cf0d3ae17a884b089df315b88bee366ffe1b9e85 100644 (file)
@@ -420,11 +420,9 @@ int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags)
        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] != '#' &&
This page took 0.045585 seconds and 5 git commands to generate.