mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
udev: exclude DRBD from block device ownership event locking
It does not make sense for udev to even open DRBD block devices (/dev/drbdX). It is on one hand not necessary as DRBD is controlled by something else in the stack (e.g., pacemaker), and it even can get cumbersome in various scenarios (e.g., DRBD9 auto-promote). Closes: #9371 Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
bc3c5e1619
commit
fee854ee8c
@ -311,6 +311,18 @@ static int worker_send_message(int fd) {
|
||||
return loop_write(fd, &message, sizeof(message), false);
|
||||
}
|
||||
|
||||
static bool shall_lock_device(struct udev_device *dev) {
|
||||
const char *sysname;
|
||||
|
||||
if (!streq_ptr("block", udev_device_get_subsystem(dev)))
|
||||
return false;
|
||||
|
||||
sysname = udev_device_get_sysname(dev);
|
||||
return !startswith(sysname, "dm-") &&
|
||||
!startswith(sysname, "md") &&
|
||||
!startswith(sysname, "drbd");
|
||||
}
|
||||
|
||||
static void worker_spawn(Manager *manager, struct event *event) {
|
||||
struct udev *udev = event->udev;
|
||||
_cleanup_(udev_monitor_unrefp) struct udev_monitor *worker_monitor = NULL;
|
||||
@ -412,9 +424,7 @@ static void worker_spawn(Manager *manager, struct event *event) {
|
||||
* udev has finished its event handling.
|
||||
*/
|
||||
if (!streq_ptr(udev_device_get_action(dev), "remove") &&
|
||||
streq_ptr("block", udev_device_get_subsystem(dev)) &&
|
||||
!startswith(udev_device_get_sysname(dev), "dm-") &&
|
||||
!startswith(udev_device_get_sysname(dev), "md")) {
|
||||
shall_lock_device(dev)) {
|
||||
struct udev_device *d = dev;
|
||||
|
||||
if (streq_ptr("partition", udev_device_get_devtype(d)))
|
||||
|
Loading…
Reference in New Issue
Block a user