master - cache: restore reported origin field
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=67d4b3b7f2be1e15af2d05faa97e8b56ddc9d668 Commit: 67d4b3b7f2be1e15af2d05faa97e8b56ddc9d668 Parent: 414d39085c3f248601bec4cea6ce508acfa59283 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Sep 20 14:26:11 2016 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Sep 20 14:26:11 2016 +0200
cache: restore reported origin field
Commit 199697accff0658a11420e263c1f85fb74cd39d3 rerouted funtion for priting cache volume origin to lvm2app app function - which however had a bug. So restore the original functionality and print correct LV as cache origin LV.
--- WHATS_NEW | 1 + lib/metadata/lv.c | 4 ++-- test/shell/lvcreate-cache.sh | 1 + 3 files changed, 4 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.166 - ===================================== + Fix reported origin lv field for cache volumes. (2.02.133) Always specify snapshot cow LV for monitoring not internal LV. (2.02.165) Fix lvchange --discard|--zero for active thin-pool. Enforce 4MiB or 25% metadata free space for thin pool operations.
lib/metadata/lv.c +2 -2
@@ -537,8 +537,8 @@ struct logical_volume *lv_origin_lv(const struct logical_volume *lv)if (lv_is_cow (lv)) origin =origin_from_cow (lv); -else if (lv_is_cache (lv) &&first_seg (lv)->origin) - origin =first_seg (lv)->origin; +else if (lv_is_cache (lv) && !lv_is_pending_delete (lv)) + origin =seg_lv (first_seg (lv),0 );else if (lv_is_thin_volume (lv) &&first_seg (lv)->origin) origin =first_seg (lv)->origin;else if (lv_is_thin_volume (lv) &&first_seg (lv)->external_lv)
test/shell/lvcreate-cache.sh +1 -0
@@ -85,6 +85,7 @@ lvremove -f $vg lvcreate --type cache-pool -L1 $vg/cpool lvcreate -H -L4 -n $lv1 $vg/cpool +check lv_field $vg/$lv1 origin "[${lv1}_corig]" check lv_field $vg/$lv1 copy_percent "0.00" # there should be something present (value differs per policy version) test -n "$(get lv_field $vg/$lv1 data_percent)"