dissect: don't pre-open swap devices, we are not going to use them

This commit is contained in:
Lennart Poettering
2022-11-26 11:27:15 +09:00
committed by Yu Watanabe
parent 5fe8dbe728
commit f52261a06d
+2 -1
View 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;