diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-01-29 12:05:58 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-01-29 12:05:58 +0100 |
commit | 8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3 (patch) | |
tree | 5e21c74027f7b0e5ca791a1c01862c9b294cb281 /lib/cache_segtype | |
parent | bfeabea631782b3f0b8ec6494c4490663c412774 (diff) | |
download | lvm2-8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3.tar.gz |
cache: use writethrough cache_mode for older metadata
When cache_mode is undefined, the read of metadata will miss to
set a bit with mode and fails to process metadata on internal
error:
Internal error: LV vg/lvol1 has uknown feature flags 0.
Fix it by setting it to writethrough mode.
Diffstat (limited to 'lib/cache_segtype')
-rw-r--r-- | lib/cache_segtype/cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 73839f4f1..afc0ec64c 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -68,7 +68,9 @@ static int _cache_pool_text_import(struct lv_segment *seg, return SEG_LOG_ERROR("cache_mode must be a string in"); if (!set_cache_pool_feature(&seg->feature_flags, str)) return SEG_LOG_ERROR("Unknown cache_mode in"); - } + } else + /* When missed in metadata, it's an old stuff - use writethrough */ + seg->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH; if (dm_config_has_node(sn, "policy")) { if (!(str = dm_config_find_str(sn, "policy", NULL))) |