From e710bac03d2625a50131ac325ad90f0d4f6f3d51 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 14 Jan 2016 13:26:15 -0600 Subject: [PATCH] Revert "lvmcache: skip drop when vg_write lock is not held" 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 998ea6f4f..1363e930a 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -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. */