Skip to contentSkip to conversation

Invalidate devices in cache after precommited metadata was wiped.

PATCH New Milan Broz 1 participant 2 messages Dec 20, 2009 – Dec 21, 2009

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 Invalidate devices in cache after precommited metadata was wiped.

The only place when vginfo->precommited is set is during metadata store in cache.

It means that if we store precommited metadata in cache, then call drop_cached_metadata without subsequent storing commited metadata, cache is not invalidated on drop cache call.

If there is no cached metadata, invalidate device info always.

This is real fix for bug 547842.

---
 lib/cache/lvmcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/cache/lvmcache.c +1 -1
index 358cd80..fa6daee 100644
@@ -173,7 +173,7 @@ static void _drop_metadata(const char *vgname)
 	 * and we must not do it again.
 	 */
 
-	if (!vginfo->precommitted)
+	if (!vginfo->precommitted || !vginfo->vgmetadata)
 		dm_list_iterate_items(info, &vginfo->infos)
 			info->status |= CACHE_INVALID;
 
Signature · 1 line
1.6.5.7
author
#1 lore raw

PATCH 1/1 Invalidate devices in cache after precommited metadata was wiped.

Quoted 8 lines · Milan Broz

The only place when vginfo->precommited is set is during metadata store in cache.

It means that if we store precommited metadata in cache, then call drop_cached_metadata without subsequent storing commited metadata, cache is not invalidated on drop cache call.

If there is no cached metadata, invalidate device info always.

NACKing this myself, the precommited metadata problem is much more complex and will require another approach.

Milan