]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect: don't pre-open swap devices, we are not going to use them
authorLennart Poettering <lennart@poettering.net>
Tue, 25 Oct 2022 15:39:00 +0000 (17:39 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Nov 2022 02:27:15 +0000 (11:27 +0900)
src/shared/dissect-image.c

index 53682b254206ad67a1229e4bbd158a60e9fbd21b..708355872fc324ab36ad8a3b8862628197c94255 100644 (file)
@@ -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;