From f52261a06dbe676d8c1834b888c8b47d5197532b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 25 Oct 2022 17:39:00 +0200 Subject: [PATCH] dissect: don't pre-open swap devices, we are not going to use them --- src/shared/dissect-image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 53682b25420..708355872fc 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -897,7 +897,8 @@ static int dissect_image( dissected_partition_done(m->partitions + type.designator); } - if (FLAGS_SET(flags, DISSECT_IMAGE_OPEN_PARTITION_DEVICES)) { + if (FLAGS_SET(flags, DISSECT_IMAGE_OPEN_PARTITION_DEVICES) && + type.designator != PARTITION_SWAP) { mount_node_fd = open_partition(node, /* is_partition = */ true, m->loop); if (mount_node_fd < 0) return mount_node_fd; -- 2.47.3