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

lvdisplay: fix show of merged thin snapshot

When lvdisplay was executed and thin snaphost has be merged to
thin origin and the operation has been postponed till devices
are closed, command crashed.

Check LV is COW before trying to check snapshot percentage.
This commit is contained in:
Zdenek Kabelac 2021-02-12 15:11:48 +01:00
parent 3af61d8646
commit 14008ead2a

View File

@ -475,7 +475,7 @@ int lvdisplay_full(struct cmd_context *cmd,
snap_active ? "active" : "INACTIVE");
}
snap_seg = NULL;
} else if ((snap_seg = find_snapshot(lv))) {
} else if (lv_is_cow(lv) && (snap_seg = find_snapshot(lv))) {
if (inkernel &&
(snap_active = lv_snapshot_percent(snap_seg->cow,
&snap_percent)))