]> git.ipfire.org Git - thirdparty/systemd.git/commit
repart: Reuse the backing fd for fdisk
authorValentin David <me@valentindavid.com>
Thu, 12 Mar 2026 22:14:23 +0000 (23:14 +0100)
committerValentin David <me@valentindavid.com>
Tue, 12 May 2026 16:31:21 +0000 (18:31 +0200)
commit3ac8bd0e97c4e3991c8d79df60549a4aee0f88ae
treeaa6d8afcb9dc1414d1c64d8bbe182c69d7069f22
parentee2c2b1b89fd4bddf6b91f18b5d0bc4524986bb4
repart: Reuse the backing fd for fdisk

Because fdisk_assign_device tries to open block devices with O_EXCL, when it
does it blocks cryptsetup from using partition block devices for the same
disk.

Since we already have a file descriptor for the device, we can just share it
and use fdisk_assign_device_by_fd instead.

This requires at least libfdisk 2.35 (part of util-linux) which was
released in 2020.
README
meson.build
src/repart/repart.c
src/shared/fdisk-util.c
src/shared/fdisk-util.h