]> sourceware.org Git - lvm2.git/commitdiff
Revert "lvmcache: skip drop when vg_write lock is not held"
authorDavid Teigland <teigland@redhat.com>
Thu, 14 Jan 2016 19:26:15 +0000 (13:26 -0600)
committerDavid Teigland <teigland@redhat.com>
Thu, 14 Jan 2016 19:34:36 +0000 (13:34 -0600)
This reverts e28e22b9e1e4f7243608aa24ddf43ec63afd1751
The problem that that commit was fixing (pytest failure)
no longer appears with the current code, so the commit is
not needed.

That commit is a problem for pvchange, because it prevents
lvmcache from retaining VG metadata even while the global
lock is held.  pvchange holds the global lock to ensure
that VG metadata is kept in lvmcache throughout processing.
If the cache is not kept, a PV with zero MDAs will appear
first in its actual VG and then appear again in the orphan VG.
It wrongly appears a second time in the orphan VG only if
the actual VG is dropped from lvmcache.

lib/cache/lvmcache.c

index 998ea6f4fd5a4a758a5627a4554eb03f69014048..1363e930a144fcf79f68f9d290543b8d6307120e 100644 (file)
@@ -332,7 +332,7 @@ void lvmcache_commit_metadata(const char *vgname)
 
 void lvmcache_drop_metadata(const char *vgname, int drop_precommitted)
 {
-       if (lvmcache_vgname_is_locked(VG_GLOBAL) && !vg_write_lock_held())
+       if (lvmcache_vgname_is_locked(VG_GLOBAL))
                return;
 
        /* For VG_ORPHANS, we need to invalidate all labels on orphan PVs. */
This page took 0.039436 seconds and 5 git commands to generate.