From: Lennart Poettering Date: Tue, 25 Oct 2022 15:39:00 +0000 (+0200) Subject: dissect: don't pre-open swap devices, we are not going to use them X-Git-Tag: v253-rc1~440 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f52261a06dbe676d8c1834b888c8b47d5197532b;p=thirdparty%2Fsystemd.git dissect: don't pre-open swap devices, we are not going to use them --- 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;