]> git.proxmox.com Git - pve-storage.git/commit
api: disk: work around udev bug to ensure its database is updated
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 28 Sep 2021 11:39:42 +0000 (13:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Sep 2021 16:04:25 +0000 (18:04 +0200)
commit21a75847a8ef3c8226c92eee1ec12ee233cd6757
treec5017b456c67bd716fef985bc4e40017f84f5dd0
parente99bc248d474796b64b7ef1d75d864cdd0b9d5df
api: disk: work around udev bug to ensure its database is updated

There is a udev bug [0] which can ultimately lead to the udev database
for certain devices not being actively updated. Determining whether a
disk is used or not in get_disks() (in part) relies upon lsblk, which
queries the udev database. Ensure the information is updated by
manually calling 'udevadm trigger' for the changed devices.

It's most important for the 'directory' API path, as mounting depends
on the '/dev/disk/by-uuid'-symlink to be generated.

[0]: https://github.com/systemd/systemd/issues/18525

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/API2/Disks.pm
PVE/API2/Disks/Directory.pm
PVE/API2/Disks/LVM.pm
PVE/API2/Disks/LVMThin.pm
PVE/API2/Disks/ZFS.pm