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

snapshot: fix reporting for merged old snapshot

When old snapshot is merged, lvm2 still can report some data about
merged 'snapshot' - i.e. it occupied space in VG.

This patch fixes regression from commit:
6fd20be629

and resolved RHBZ: 1460161
This commit is contained in:
Zdenek Kabelac 2017-06-09 21:00:05 +02:00
parent b6945b8510
commit 5e7db7d85d
2 changed files with 2 additions and 3 deletions

View File

@ -835,7 +835,6 @@ int lv_info_with_seg_status(struct cmd_context *cmd,
* When merge is in progress, query merging origin LV instead.
* COW volume is already mapped as error target in this case.
*/
status->lv = olv;
return 1;
}

View File

@ -172,7 +172,7 @@ static int _do_lvs_with_info_and_status_single(struct cmd_context *cmd,
if (lv_is_merging_origin(lv)) {
if (!_check_merging_origin(lv, &status, &merged))
goto_out;
if (merged)
if (merged && lv_is_thin_volume(lv->snapshot->lv))
lv = lv->snapshot->lv;
}
@ -234,7 +234,7 @@ static int _do_segs_with_info_and_status_single(struct cmd_context *cmd,
if (lv_is_merging_origin(seg->lv)) {
if (!_check_merging_origin(seg->lv, &status, &merged))
goto_out;
if (merged)
if (merged && lv_is_thin_volume(seg->lv->snapshot->lv))
seg = seg->lv->snapshot;
}