I think we need a udev plumbing expert, I've exhausted my udev
knowledge.

For older releases such as bionic we have one event:

UDEV [1304.304437] change /devices/virtual/block/bcache0 (block)
.ID_FS_TYPE_NEW=
ACTION=change
CACHED_LABEL=
CACHED_UUID=0192e0a7-9d8e-4771-9bb1-d730a2f66a9d
DEVLINKS=/dev/bcache/by-uuid/0192e0a7-9d8e-4771-9bb1-d730a2f66a9d
DEVNAME=/dev/bcache0
DEVPATH=/devices/virtual/block/bcache0
DEVTYPE=disk
DRIVER=bcache
ID_FS_TYPE=
MAJOR=251
MINOR=0
SEQNUM=4384
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=1304237024

that creates the expected symlink.

---------

For focal, instead we get two events:

UDEV [2763.370729] change /devices/virtual/block/bcache0 (block)
ACTION=change
DEVPATH=/devices/virtual/block/bcache0
SUBSYSTEM=block
DRIVER=bcache
CACHED_UUID=1522715e-a390-40db-8d47-06fb728014e5
CACHED_LABEL=
DEVNAME=/dev/bcache0
DEVTYPE=disk
SEQNUM=5523
USEC_INITIALIZED=2763323504
.ID_FS_TYPE_NEW=
ID_FS_TYPE=
MAJOR=251
MINOR=0
DEVLINKS=/dev/bcache/by-uuid/1522715e-a390-40db-8d47-06fb728014e5
TAGS=:systemd:

KERNEL[2784.362374] change /devices/virtual/block/bcache0 (block)
ACTION=change
DEVPATH=/devices/virtual/block/bcache0
SUBSYSTEM=block
SYNTH_UUID=0
DEVNAME=/dev/bcache0
DEVTYPE=disk
SEQNUM=5524
MAJOR=251
MINOR=0

UDEV [2784.433618] change /devices/virtual/block/bcache0 (block)
ACTION=change
DEVPATH=/devices/virtual/block/bcache0
SUBSYSTEM=block
SYNTH_UUID=0
DEVNAME=/dev/bcache0
DEVTYPE=disk
SEQNUM=5524
USEC_INITIALIZED=2763323504
ID_FS_UUID=30b28bee-6a1e-423d-9d53-32c78ba5454a
ID_FS_UUID_ENC=30b28bee-6a1e-423d-9d53-32c78ba5454a
ID_FS_VERSION=1.0
ID_FS_TYPE=ext4
ID_FS_USAGE=filesystem
.ID_FS_TYPE_NEW=ext4
MAJOR=251
MINOR=0
DEVLINKS=/dev/disk/by-uuid/30b28bee-6a1e-423d-9d53-32c78ba5454a
TAGS=:systemd:

This performs:

pr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Processing device 
(SEQNUM=5523, ACTION=change)
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Removing watch
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: value '[dmi/id]sys_vendor' is 
'QEMU'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: value '[dmi/id]sys_vendor' is 
'QEMU'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: 
/usr/lib/udev/rules.d/60-persistent-storage.rules:109 Importing properties from 
results of builtin command 'blkid'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Probe /dev/bcache0 
with raid and offset=0
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: 
/usr/lib/udev/rules.d/69-bcache.rules:16 Importing properties from results of 
'probe-bcache -o udev /dev/bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Starting 
'probe-bcache -o udev /dev/bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: Successfully forked off 
'(spawn)' as PID 1912.
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Process 
'probe-bcache -o udev /dev/bcache0' succeeded.
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: 
/usr/lib/udev/rules.d/69-bcache.rules:27 LINK 
'bcache/by-uuid/1522715e-a390-40db-8d47-06fb728014e5'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Handling device node 
'/dev/bcache0', devnum=b251:0
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Preserve already 
existing symlink '/dev/block/251:0' to '../bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Creating symlink 
'/dev/bcache/by-uuid/1522715e-a390-40db-8d47-06fb728014e5' to '../../bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: sd-device: Created 
db file '/run/udev/data/b251:0' for '/devices/virtual/block/bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Adding watch on 
'/dev/bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: sd-device: Created 
db file '/run/udev/data/b251:0' for '/devices/virtual/block/bcache0'
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: Device (SEQNUM=5523, 
ACTION=change) processed
Apr 21 14:15:22 ubuntu-focal systemd-udevd[1870]: bcache0: sd-device-monitor: 
Passed 388 byte to netlink monitor

followed by the extra action:

Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Processing device 
(SEQNUM=5524, ACTION=change)
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Removing watch
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: value '[dmi/id]sys_vendor' is 
'QEMU'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: value '[dmi/id]sys_vendor' is 
'QEMU'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: 
/usr/lib/udev/rules.d/60-persistent-storage.rules:109 Importing properties from 
results of builtin command 'blkid'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Probe /dev/bcache0 
with raid and offset=0
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: 
/usr/lib/udev/rules.d/60-persistent-storage.rules:112 LINK 
'disk/by-uuid/30b28bee-6a1e-423d-9d53-32c78ba5454a'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Updating old name, 
'/dev/bcache/by-uuid/1522715e-a390-40db-8d47-06fb728014e5' no longer belonging 
to '/devices/virtual/block/bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: No reference left, 
removing '/dev/bcache/by-uuid/1522715e-a390-40db-8d47-06fb728014e5'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Handling device node 
'/dev/bcache0', devnum=b251:0
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Preserve already 
existing symlink '/dev/block/251:0' to '../bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Creating symlink 
'/dev/disk/by-uuid/30b28bee-6a1e-423d-9d53-32c78ba5454a' to '../../bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: sd-device: Created 
db file '/run/udev/data/b251:0' for '/devices/virtual/block/bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Adding watch on 
'/dev/bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: sd-device: Created 
db file '/run/udev/data/b251:0' for '/devices/virtual/block/bcache0'
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: Device (SEQNUM=5524, 
ACTION=change) processed
Apr 21 14:15:43 ubuntu-focal systemd-udevd[1916]: bcache0: sd-device-monitor: 
Passed 471 byte to netlink monitor

So it appears the symlink is being added to /dev/bcache/by-
uuid/1522715e-a390-40db-8d47-06fb728014e5 and then the next udev action
removes this symlink and adds dev/disk/by-uuid/30b28bee-6a1e-423d-
9d53-32c78ba5454a instead.


** Also affects: udev (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: udev (Ubuntu)
     Assignee: (unassigned) => Dimitri John Ledkov (xnox)

** Changed in: udev (Ubuntu)
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1861941

Title:
  bcache by-uuid links disappear after mounting bcache0

Status in linux package in Ubuntu:
  Incomplete
Status in linux-signed-5.4 package in Ubuntu:
  New
Status in udev package in Ubuntu:
  New

Bug description:
  1.
  root@ubuntu:~# lsb_release -rd
  Description:  Ubuntu Focal Fossa (development branch)
  Release:      20.04

  2. 
  root@ubuntu:~# lsb_release -rd
  Description:  Ubuntu Focal Fossa (development branch)
  Release:      20.04
  root@ubuntu:~# apt-cache policy linux-image-virtual 
  linux-image-virtual:
    Installed: 5.4.0.12.15
    Candidate: 5.4.0.12.15
    Version table:
   *** 5.4.0.12.15 500
          500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
          100 /var/lib/dpkg/status
  root@ubuntu:~# apt-cache policy linux-image-5.4.0-12-generic 
  linux-image-5.4.0-12-generic:
    Installed: 5.4.0-12.15
    Candidate: 5.4.0-12.15
    Version table:
   *** 5.4.0-12.15 500
          500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
          100 /var/lib/dpkg/status

  3. mount /dev/bcache0 && ls -al /dev/bcache/by-uuid/
  + ls -al /dev/bcache/by-uuid/
  total 0
  drwxr-xr-x 2 root root 60 Feb  4 23:31 .
  drwxr-xr-x 3 root root 60 Feb  4 23:31 ..
  lrwxrwxrwx 1 root root 13 Feb  4 23:31 abdfd1f6-44ce-4266-91db-24667b9ae51a 
-> ../../bcache0

  4.
  root@ubuntu:~# ls -al /dev/bcache/by-uuid
  ls: cannot access '/dev/bcache/by-uuid': No such file or directory

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: linux-image-5.4.0-12-generic 5.4.0-12.15
  ProcVersionSignature: Ubuntu 5.4.0-12.15-generic 5.4.8
  Uname: Linux 5.4.0-12-generic x86_64
  ApportVersion: 2.20.11-0ubuntu16
  Architecture: amd64
  Date: Tue Feb  4 23:31:52 2020
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=C.UTF-8
   SHELL=/bin/bash
  SourcePackage: linux-signed-5.4
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1861941/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to