summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-10-25 17:39:00 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-11-26 11:27:15 +0900
commitf52261a06dbe676d8c1834b888c8b47d5197532b (patch)
tree72cfa2c6b6c830f4e948539f29964a0d2166564e /src
parent5fe8dbe728e5a4aeda0c6ce7748592614565dbe9 (diff)
downloadsystemd-f52261a06dbe676d8c1834b888c8b47d5197532b.tar.gz
dissect: don't pre-open swap devices, we are not going to use them
Diffstat (limited to 'src')
-rw-r--r--src/shared/dissect-image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 53682b2542..708355872f 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;