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

Do not set precommitted flag in cache when precommitted metadata does not exist.

The use_precommitted flag indicates, that we want to use precommitted metadata
(used in suspend call to preload table with precommitted data).

But if there are no such data, committed metadata are read but the cache
still contains that precommitted flag.

(The problem is that later possible drop_metadata call will not invalidate
device in cache.)

The wrong precommitted state is stored in on remote nodes during normal
suspend/resume cycle _without_ vg_write/commit.

Use the PRECOMMITTED status flag here instead (which is always set if using
precommited metadata here).
This commit is contained in:
Milan Broz 2010-01-05 16:01:22 +00:00
parent 60494fe74b
commit 4b1687fb74
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.57 -
====================================
Properly handle precommitted flag in cache when commited data only present.
Resume renamed volumes in reverse order to preserve memlock pairing.
Drop metadata cache after device was autorepaired and removed from VG.
Remove missing flag in metadata if PV reappeared and is empty.

View File

@ -2620,7 +2620,11 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
if (!inconsistent_pvs) {
log_debug("Updating cache for PVs without mdas "
"in VG %s.", vgname);
lvmcache_update_vg(correct_vg, use_precommitted);
/*
* If there is no precommitted metadata, committed metadata
* is read and stored in the cache even if use_precommitted is set
*/
lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED);
if (!(pvids = lvmcache_get_pvids(cmd, vgname, vgid)))
return_NULL;
@ -2721,7 +2725,11 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
return_NULL;
}
lvmcache_update_vg(correct_vg, use_precommitted);
/*
* If there is no precommitted metadata, committed metadata
* is read and stored in the cache even if use_precommitted is set
*/
lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED);
if (inconsistent) {
/* FIXME Test should be if we're *using* precommitted metadata not if we were searching for it */