[Parted-maintainers] Bug#1021653: parted: prefer exclusively locking devices over calling udevadm settle

Christopher Obbard chris.obbard at collabora.com
Wed Oct 12 10:49:31 BST 2022


Package: parted
Version: 3.5-2
Severity: important

Dear Maintainer,

Currently with debian/patches/udevadm-settle.patch, `udevadm settle` is called
around the opening/closing of the block device. This is supposed to wait for
udev to process device creation events and ensuring that the device nodes have
been created.

I don't think this call is needed, instead we should lock the device using
flock(LOCK_EX) and hold the lock until we are done with the device.

According to systemd documentation, https://systemd.io/BLOCK_DEVICE_LOCKING/
this is the correct way to stop udev from processing events on the block device
while it is being modified.

This method could also be pushed upstream to parted, there is an outstanding
patch (long before systemd!) which could be used for inspiration:
https://www.mail-archive.com/parted-devel@lists.alioth.debian.org/msg04119.html

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.19.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages parted depends on:
ii  libc6         2.35-1
ii  libparted2    3.5-2
ii  libreadline8  8.2~rc2-2
ii  libtinfo6     6.3+20220423-2

parted recommends no packages.

Versions of packages parted suggests:
pn  parted-doc  <none>

-- no debconf information



More information about the Parted-maintainers mailing list