summaryrefslogtreecommitdiffstats
path: root/misc-utils/lsblk-devtree.c
diff options
context:
space:
mode:
authorManuel Bentele2019-08-21 14:58:42 +0200
committerManuel Bentele2019-08-21 14:58:42 +0200
commit0692b963aa3cb846d8abab5ef5247c4dbb3fec96 (patch)
treef13776d25da3e1adc1445aef22e7566ac98cbe84 /misc-utils/lsblk-devtree.c
parentlosetup: added file format option to the man page (diff)
parentpartx: document -d vs. --nr and fix test (diff)
downloadkernel-qcow2-util-linux-kernel-qcow2.tar.gz
kernel-qcow2-util-linux-kernel-qcow2.tar.xz
kernel-qcow2-util-linux-kernel-qcow2.zip
lib/losetup: merge remote-tracking branch 'util-linux/master'kernel-qcow2
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
Diffstat (limited to 'misc-utils/lsblk-devtree.c')
-rw-r--r--misc-utils/lsblk-devtree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc-utils/lsblk-devtree.c b/misc-utils/lsblk-devtree.c
index a2aa26aed..4d15f70c1 100644
--- a/misc-utils/lsblk-devtree.c
+++ b/misc-utils/lsblk-devtree.c
@@ -384,6 +384,7 @@ static int device_dedupkey_is_equal(
return 0;
if (strcmp(dev->dedupkey, pattern->dedupkey) == 0) {
if (!device_is_partition(dev) ||
+ !dev->wholedisk->dedupkey ||
strcmp(dev->dedupkey, dev->wholedisk->dedupkey) != 0) {
DBG(DEV, ul_debugobj(dev, "%s: match deduplication pattern", dev->name));
return 1;
@@ -458,6 +459,7 @@ int lsblk_devtree_deduplicate_devices(struct lsblk_devtree *tr)
if (!pattern->dedupkey)
continue;
if (device_is_partition(pattern) &&
+ pattern->wholedisk->dedupkey &&
strcmp(pattern->dedupkey, pattern->wholedisk->dedupkey) == 0)
continue;
if (last && strcmp(pattern->dedupkey, last) == 0)