1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

only read labels once between each lock event

This commit is contained in:
Alasdair Kergon 2008-01-30 16:18:37 +00:00
parent 2871881859
commit 16e2a5aa3b

10
lib/cache/lvmcache.c vendored
View File

@ -225,6 +225,16 @@ static int _info_is_valid(struct lvmcache_info *info)
if (info->status & CACHE_INVALID)
return 0;
/*
* The caller must hold the VG lock to manipulate metadata.
* In a cluster, remote nodes sometimes read metadata in the
* knowledge that the controlling node is holding the lock.
* So if the VG appears to be unlocked here, it should be safe
* to use the cached value.
*/
if (info->vginfo && !vgname_is_locked(info->vginfo->vgname))
return 1;
if (!(info->status & CACHE_LOCKED))
return 0;