1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

clvmd: keep old saved_vg if it matches new

There is no need to release the old saved_vg
if it matches the new version.
This commit is contained in:
David Teigland 2018-04-30 13:00:05 -05:00
parent 39f24a169c
commit 89935ace29

View File

@ -360,7 +360,8 @@ struct volume_group *lvmcache_get_saved_vg(const char *vgid, int precommitted)
/* Do we need to actually set saved_vg_old to match saved_vg_new?
* By just dropping old, we force a subsequent request for old to
* reread it rather than just using new. */
if (vginfo->saved_vg_old) {
if (vginfo->saved_vg_old && (vginfo->saved_vg_old < vg->seqno)) {
log_debug_cache("lvmcache: drop saved_vg_old because new invalidates");
_saved_vg_free(vginfo, 1, 0);
}
@ -425,7 +426,8 @@ struct volume_group *lvmcache_get_saved_vg_latest(const char *vgid)
/* Do we need to actually set saved_vg_old to match saved_vg_new?
* By just dropping old, we force a subsequent request for old to
* reread it rather than just using new. */
if (vginfo->saved_vg_old) {
if (vginfo->saved_vg_old && (vginfo->saved_vg_old->seqno < vg->seqno)) {
log_debug_cache("lvmcache: drop saved_vg_old because new invalidates");
_saved_vg_free(vginfo, 1, 0);
}