summaryrefslogtreecommitdiff
path: root/lib/display
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-02-12 15:11:48 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-02-17 11:21:35 +0100
commit14008ead2a42b4a5db0c81e444f9ea1a05c1a899 (patch)
tree56136a018c16d23446c4a392a5d71141e2824689 /lib/display
parent3af61d8646765fea95a77618e9bfc7e1c35f7ea2 (diff)
downloadlvm2-14008ead2a42b4a5db0c81e444f9ea1a05c1a899.tar.gz
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.
Diffstat (limited to 'lib/display')
-rw-r--r--lib/display/display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/display/display.c b/lib/display/display.c
index a84695393..f0f03c0a5 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -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)))