[lvm-devel] [PATCH 2/4] lvconvert_poll: check whether lv is a snapshot type in poll_thin_merge_progress

Wu Guanghao wuguanghao3 at huawei.com
Fri Sep 11 09:41:01 UTC 2020


lv may not be a snapshot type, the return value of find_snapshot(lv) may be NULL.
Here, we will call stack if lv is not a snapshot type.

Signed-off-by: Wu Guanghao <wuguanghao3 at huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26 at huawei.com>
---
 tools/lvconvert_poll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lvconvert_poll.c b/tools/lvconvert_poll.c
index b9ec316e1..d0831cfd8 100644
--- a/tools/lvconvert_poll.c
+++ b/tools/lvconvert_poll.c
@@ -176,7 +176,7 @@ progress_t poll_thin_merge_progress(struct cmd_context *cmd,
 {
 	uint32_t device_id;

-	if (!lv_thin_device_id(lv, &device_id)) {
+	if (!lv_thin_device_id(lv, &device_id) || !lv_is_snapshot(lv)) {
 		stack;
 		return PROGRESS_CHECK_FAILED;
 	}
-- 




More information about the lvm-devel mailing list