I'm also seeing two variations of this bug that reverting util-linux
commit 3bbdae633f4 did not solve:

1. when util-linux fsck takes an exclusive lock it only does so for
rotational disks. See the early guard on is_irrotational_disk(disk) in
lock_disk() in disk-utils/fsck.c. (You can see awareness of this in the
ext4 thread here: https://lore.kernel.org/linux-
ext4/20260824224006.GB6038@frogsfrogsfrogs/t/#mbed58eb64351e825173ccd2615ca1a14c5447bfc
-- the patch from that thread would avoid this problem but not problem
#2 below)

2. systemd-udev does not take a shared lock on the disk if the device in
the uevent starts with "dm-", "md", or "drbd". In that case, I sometimes
see a similar error to what I first described in your ticket, except for
the output of systemctl list-dependencies -a <failed mount unit>. That
shows only the systemd-fsck@ service failing. The symlink device unit
doesn't fail, and its symlink in /dev/disk/by-uuid exists:

Oct 04 08:58:15 a198-18-42-23.deploy.akamaitechnologies.com 
(udev-worker)[2904]: dm-3: udev_get_whole_disk() ignored device dm-3
...
Oct 04 08:58:15 a198-18-42-23.deploy.akamaitechnologies.com systemd[1]: 
systemd-fsck@dev-disk-by\x2duuid-0d5a3255\x2dede9\x2d47ef\x2dba98\x2d8897a8b6421a.service:
 Deactivated successfully.
Oct 04 08:58:15 a198-18-42-23.deploy.akamaitechnologies.com systemd[1]: Stopped 
systemd-fsck@dev-disk-by\x2duuid-0d5a3255\x2dede9\x2d47ef\x2dba98\x2d8897a8b6421a.service
 - File System Check on /dev/disk/by-uuid/0d5a3255-ede9-47ef-ba98-8897a8b6421a.

That first log message comes from my adding the following patch to
udevd:

---
 src/udev/udev-worker.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/src/udev/udev-worker.c
===================================================================
--- a/src/udev/udev-worker.c
+++ b/src/udev/udev-worker.c
@@ -54,8 +54,10 @@ int udev_get_whole_disk(sd_device *dev,
          * but not sure the assumption is still valid even when partitions are 
created on the md
          * devices, surprisingly which seems to be possible, see PR #22973.
          * For "drbd", see the commit message of 
fee854ee8ccde0cd28e0f925dea18cce35f3993d. */
-        if (STARTSWITH_SET(val, "dm-", "md", "drbd"))
+        if (STARTSWITH_SET(val, "dm-", "md", "drbd")) {
+                log_device_warning(dev, "udev_get_whole_disk() ignored device 
%s", val);
                 goto irrelevant;
+        }
 
         r = block_device_get_whole_disk(dev, &dev);
         if (IN_SET(r,


And note the how only the one systemd-fsck@ unit shows as failed here:

/scp:[email protected]:/var/tmp # sc list-dependencies -a tmp.mount
tmp.mount
● ├─-.mount
● │ └─-.slice
● ├─dev-disk-by\x2duuid-0d5a3255\x2dede9\x2d47ef\x2dba98\x2d8897a8b6421a.device
● ├─system.slice
● │ └─-.slice
○ 
└─systemd-fsck@dev-disk-by\x2duuid-0d5a3255\x2dede9\x2d47ef\x2dba98\x2d8897a8b6421a.service
●   
├─dev-disk-by\x2duuid-0d5a3255\x2dede9\x2d47ef\x2dba98\x2d8897a8b6421a.device
●   ├─system-systemd\x2dfsck.slice
●   │ └─system.slice
●   │   └─-.slice
●   └─systemd-fsckd.socket
●     ├─-.mount
●     │ └─-.slice
●     └─system.slice
●       └─-.slice 

Maybe the linux ext4 people will come up with a better solution at the
e2fsprogs level, but it seems like systemd-udev also needs more thorough
locking to cover the diskmapper cases.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160558

Title:
  udevd and fsck contend causing the prior to miss fs uuids

To manage notifications about this bug go to:
https://bugs.launchpad.net/util-linux-ng/+bug/2160558/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to