]> sourceware.org Git - lvm2.git/commitdiff
lvdisplay: fix show of merged thin snapshot
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 12 Feb 2021 14:11:48 +0000 (15:11 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Feb 2021 10:21:35 +0000 (11:21 +0100)
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.

lib/display/display.c

index a846953934fac1249b3fc12ea8dc5b962af4936e..f0f03c0a54116e963fc3cd0a9d30de44cd5f535d 100644 (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)))
This page took 0.034049 seconds and 5 git commands to generate.