mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Revert "lvmcache: skip drop when vg_write lock is not held"
This reverts e28e22b9e1
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.
This commit is contained in:
parent
b82d5ee092
commit
e710bac03d
2
lib/cache/lvmcache.c
vendored
2
lib/cache/lvmcache.c
vendored
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user