From: Zdenek Kabelac Date: Fri, 10 Feb 2017 18:57:04 +0000 (+0100) Subject: libdm: avoid resume if preloaded device is smaller X-Git-Tag: v2_02_169~438 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=c908a8b131d0ae12cf87a271b10dfeaf65d4e0a7;p=lvm2.git libdm: avoid resume if preloaded device is smaller When we preload device with smaller size, we avoid its resume, so later suspend/resume of full device tree my process all existing in flight bios. Also update comment and avoid using confusing opposite meaning. --- diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index ac2d42020..47f647a6a 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.138 - ===================================== + Avoids immediate resume when preloaded device is smaller. Do not suppress kernel key description in dmsetup table output. Support configurable command executed from dmeventd thin plugin. Support new R|r human readable units output format. diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 9570b8abb..d658bf99d 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -2874,8 +2874,8 @@ int dm_tree_preload_children(struct dm_tree_node *dnode, else if (child->props.size_changed < 0) dnode->props.size_changed = -1; - /* Resume device immediately if it has parents and its size changed */ - if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed) + /* No resume for a device without parents or with unchanged or smaller size */ + if (!dm_tree_node_num_children(child, 1) || (child->props.size_changed <= 0)) continue; if (!node_created && (dm_list_size(&child->props.segs) == 1)) {