Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8650404df1884f1e…
Commit: 8650404df1884f1e040aad4343c8db0eac71e125
Parent: 531cc58d899b7dd1421bfe83f5503aa266390334
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 30 11:13:49 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 30 11:13:49 2015 +0100
properties: also recognize LVSINFO, LVSSTATUS and LVSINFOSTATUS as subtypes of LVS
LVSINFO, LVSSTATUS and LVSINFOSTATUS is the same as LVS, just with some
extra info/status decoration attached to it. Recognize this when looking
for properties for lvm2app. This fixes lvm_lv_get_property lvm2app call
for fields which already use LVS{INFO,STATUS,INFOSTATUS} - currently,
this is lv_attr field which was converted to LVSINFOSTATUS from
pure LVS type.
---
lib/report/properties.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 8866928..c1c9563 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -476,7 +476,7 @@ int lvseg_get_property(const struct lv_segment *lvseg,
int lv_get_property(const struct logical_volume *lv,
struct lvm_property_type *prop)
{
- return prop_get_property(_properties, lv, prop, LVS);
+ return prop_get_property(_properties, lv, prop, LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS);
}
int vg_get_property(const struct volume_group *vg,
@@ -500,7 +500,7 @@ int pv_get_property(const struct physical_volume *pv,
int lv_set_property(struct logical_volume *lv,
struct lvm_property_type *prop)
{
- return prop_set_property(_properties, lv, prop, LVS);
+ return prop_set_property(_properties, lv, prop, LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS);
}
int vg_set_property(struct volume_group *vg,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=531cc58d899b7dd1…
Commit: 531cc58d899b7dd1421bfe83f5503aa266390334
Parent: 8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 30 09:45:22 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 30 09:53:34 2015 +0100
lvm2app: fix lvm_lv_get_attr regression causing unknown values
This is a regression from v115 where some of the fields/properties
were converted to using the common "struct lvinfo" and
"struct lv_seg_status" so we don't need to issue info and status
ioctl several times per one reported line. Not all fields are
converted yet, but one that *is* converted is the lv_attr field
with the lv_attr_dup counterpart used in lvm_lv_get_attr lvm2app fn.
These changes were introduced with e34b004422f0d51263e0d34f4064556cfc9148f6
and later - this patch introduced the "info_ok" field in the
lv_with_info_and_seg_status structure which encapsulates the lvinfo
and lv_seg_status struct.
For the lv_attr_dup, the lv_attr_dup code missed the
assignment for the "info_ok" flag which saves the result of the
lv_info_with_seg_status call. Hence such info was marked
as unusable - unknown and it was returned as such via lvm_lv_get_attr
lvm2app fn.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f2546a9..62f03ef 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Fix lvm2app regression in lvm_lv_get_attr causing unknown values (2.02.115).
Set default cache_mode to writehrough when missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 9052e63..c3c5d4a 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -831,7 +831,7 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
if (!(status.seg_status.mem = dm_pool_create("reporter_pool", 1024)))
return_0;
- if (!lv_info_with_seg_status(lv->vg->cmd, lv, first_seg(lv), 1, &status, 1, 1))
+ if (!(status.info_ok = lv_info_with_seg_status(lv->vg->cmd, lv, first_seg(lv), 1, &status, 1, 1)))
goto_bad;
ret = lv_attr_dup_with_info_and_seg_status(mem, &status);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8dc1da2cbed42e9c…
Commit: 8dc1da2cbed42e9c5a4dee5b342bb4aff8c9d9a3
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 12:05:58 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 12:05:58 2015 +0100
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.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..f2546a9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode to writehrough when missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..afc0ec6 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)))
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f654139e6870ff1c…
Commit: f654139e6870ff1ce15238ce19842921449273fc
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 11:53:30 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 11:53:30 2015 +0100
cache: use built-in define for cache_mode
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 using compile time DEFAULTS.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..2a58a8b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode when unset/missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..5de7baf 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,8 @@ 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 if (!set_cache_pool_feature(&seg->feature_flags, DEFAULT_CACHE_POOL_CACHEMODE))
+ return SEG_LOG_ERROR(INTERNAL_ERROR "Unknown built-in cache_mode");
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=84557040129b284c…
Commit: 84557040129b284c50f68124b4b3eeb5497baeb6
Parent: bfeabea631782b3f0b8ec6494c4490663c412774
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 29 11:47:00 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 29 11:49:27 2015 +0100
cache: use built-in define for cache_mode
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 using compile time DEFAULTS.
---
WHATS_NEW | 1 +
lib/cache_segtype/cache.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 92b62a6..2a58a8b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Set default cache_mode when unset/missing in metadata.
Preserve chunk size with repair and metadata swap of a thin pool.
Fix raid --splitmirror 1 functionality (2.02.112).
Fix tree preload to handle splitting raid images.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..0cab85a 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,8 @@ 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 if (!set_cache_pool_feature(&seg->feature_flags, DEFAULT_CACHE_POOL_CACHEMODE))
+ return SEG_LOG_ERROR(INTERNAL_ERROR "Unknown built-in cache_mode");
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))
@@ -77,7 +78,7 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("Failed to duplicate policy in");
} else
/* Cannot use 'just' default, so pick one */
- seg->policy_name = DEFAULT_CACHE_POOL_POLICY; /* FIXME make configurable */
+ seg->policy_name = DEFAULT_CACHE_POOL_CACHEMODE; /* FIXME make configurable */
/*
* Read in policy args: