bcache by-uuid links disappear after mounting bcache0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bcache-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Won't Fix
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
SRU TEAM: The last 2 commits show a summary for the merges/changes
I added some specific (to Bionic) notes in the template.
Thanks!
[Impact]
* bcache-tools udev created symlinks might disappear when other udev events are processed for the same devices.
* after mkfs.XXX in /dev/bcacheY you might face a condition where /dev/bcache/
* /dev/bcache/
* it was also discussed in this bug that systemd-udev should *not* populate /dev/disk/by-uuid/ with symlinks of disks that were bcache backing devices. this was turned into a discussion whether blkid should report those or not, and this discussion "died" after sometime. This last item is what the systemd update is all about: to disallow /dev/disk/
[Test Case]
* The reproducer script is here:
https:/
* Bionic can't reproduce the issue with the 18.04 kernel, nor with the HWE kernel. Nevertheless, it is preferable that Bionic also do the same thing: to read bcache superblock and feed environment for /dev/bcache/
specifically for the verification for systemd, the above script can be used, and then check that the bcache uuid symlink isn't present at /dev/disk/by-uuid; for example, after running the above reproducer script:
root@lp1861941-f:~# ls -l /dev/bcache/
total 0
lrwxrwxrwx 1 root root 13 Nov 2 17:16 651c5532-
root@lp1861941-f:~# ls -l /dev/disk/
lrwxrwxrwx 1 root root 9 Nov 2 17:16 /dev/disk/
[Regression Potential]
* We are not depending on bcache device udev events any more when creating the /dev/bcache/
* Previously we were thinking in asking the kernel team to remove the bcache udev event delta script they've done for previous case (LP: #1729145). It creates the udev events that were being read and filling the symlinks. We decided not to remove those (just from Groovy and on) so we don't need to worry on Breaks/Conflicts in between the kernel package and bcache-tools (and udev)).
* Long story short: kernel will continue to emit bcache udev events as it did previously but now those events won't be used by anything - after installing this SRU - because udev wrapper script is doing this job (and doing it properly)
[Other Info]
- Original 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-
Installed: 5.4.0.12.15
Candidate: 5.4.0.12.15
Version table:
*** 5.4.0.12.15 500
500 http://
100 /var/lib/
root@ubuntu:~# apt-cache policy linux-image-
linux-image-
Installed: 5.4.0-12.15
Candidate: 5.4.0-12.15
Version table:
*** 5.4.0-12.15 500
500 http://
100 /var/lib/
3. mount /dev/bcache0 && ls -al /dev/bcache/
+ ls -al /dev/bcache/
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-
4.
root@ubuntu:~# ls -al /dev/bcache/by-uuid
ls: cannot access '/dev/bcache/
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-
ProcVersionSign
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-
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: linux-signed-5.4
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 154 lines (+115/-2)4 files modifieddebian/changelog (+7/-0)
debian/control (+3/-2)
debian/patches/0003-Add-bcache-export-cached-helper.patch (+104/-0)
debian/patches/series (+1/-0)
- Rafael David Tinoco (community): Approve
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 154 lines (+115/-2)4 files modifieddebian/changelog (+7/-0)
debian/control (+3/-2)
debian/patches/0003-Add-bcache-export-cached-helper.patch (+104/-0)
debian/patches/series (+1/-0)
- Rafael David Tinoco (community): Approve
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 212 lines (+116/-53)5 files modifieddebian/changelog (+8/-0)
debian/control (+3/-2)
debian/patches/0003-Add-bcache-export-cached-helper.patch (+104/-0)
debian/patches/series (+1/-1)
dev/null (+0/-50)
- Server Team CI bot: Approve (continuous-integration)
- Dan Watkins (community): Approve
-
Diff: 38 lines (+3/-3)3 files modifiedtests/vmtests/test_mdadm_bcache.py (+1/-1)
tests/vmtests/test_nvme.py (+1/-1)
tests/vmtests/test_raid5_bcache.py (+1/-1)
CVE References
Changed in linux-signed-5.4 (Ubuntu): | |
importance: | Undecided → Medium |
assignee: | nobody → Colin Ian King (colin-king) |
tags: | added: rls-gg-incoming |
tags: | added: id-5eb42c73b200d93d8fb66e1e |
affects: | linux-signed-5.4 (Ubuntu) → linux-signed (Ubuntu) |
tags: | removed: rls-ff-incoming rls-gg-incoming |
Changed in systemd (Ubuntu Groovy): | |
status: | New → In Progress |
tags: | added: patch |
Changed in systemd (Ubuntu Focal): | |
status: | Invalid → Confirmed |
Changed in linux-signed (Ubuntu Groovy): | |
assignee: | Colin Ian King (colin-king) → nobody |
no longer affects: | linux-signed (Ubuntu Bionic) |
no longer affects: | linux-signed (Ubuntu Groovy) |
no longer affects: | linux-signed (Ubuntu Focal) |
no longer affects: | linux (Ubuntu Groovy) |
Changed in systemd (Ubuntu Groovy): | |
assignee: | Balint Reczey (rbalint) → nobody |
no longer affects: | linux (Ubuntu Focal) |
no longer affects: | linux (Ubuntu Bionic) |
Changed in bcache-tools (Ubuntu Groovy): | |
status: | Triaged → Confirmed |
no longer affects: | systemd (Ubuntu Groovy) |
Changed in bcache-tools (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in bcache-tools (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Bionic): | |
importance: | Undecided → Medium |
no longer affects: | util-linux (Ubuntu) |
no longer affects: | bcache-tools (Ubuntu Groovy) |
Changed in bcache-tools (Ubuntu): | |
status: | Confirmed → Fix Released |
importance: | High → Medium |
Changed in systemd (Ubuntu): | |
importance: | High → Medium |
status: | Fix Released → Triaged |
Changed in systemd (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in systemd (Ubuntu Focal): | |
status: | Confirmed → Triaged |
Changed in bcache-tools (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in systemd (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in systemd (Ubuntu Bionic): | |
status: | In Progress → Won't Fix |
Changed in linux (Ubuntu): | |
status: | New → Fix Committed |
root@ubuntu:~# bash -x ./test- bcache- byuuid- links.sh block/bcache0/ bcache/ stop /sys/class/ block/bcache0/ bcache/ stop block/bcache0/ bcache/ stop -a -e /sys/class/ block/bcache0/ bcache/ stop ']' block/bcache0/ bcache/ stop' block/bcache0/ bcache/ stop block/bcache0/ bcache/ stop block/bcache0/ bcache/ stop': No such file or directory bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop /sys/fs/ bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop -a -e /sys/fs/ bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop ']' bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop' bcache/ 06727454- 1020-4b7b- 99ef-14789f7f7f 3b/stop bcache/ *-*-*-* /stop' bcache/ *-*-*-* /stop': No such file or directory b5fd-439b- bea3-df7ee65d0b 8d a773-4fca- a456-f10bd3ea17 b2 8f3c-46ba- b656-0442b511bf e7 a773-4fca- a456-f10bd3ea17 b2 by-uuid/ 8f3c-46ba- b656-0442b511bf e7 -> ../../bcache0 b276-42c1- b999-e299283537 96
+ mountpoint /mnt
/mnt is a mountpoint
+ umount -f /mnt
+ '[' -e /dev/bcache0 ']'
+ wipefs -a /dev/bcache0
/dev/bcache0: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
+ true
++ ls /sys/class/
+ bdev_stop=
+ '[' -n /sys/class/
+ echo 'writing 1 to /sys/class/
writing 1 to /sys/class/
+ echo 1
+ udevadm settle
+ sleep 1
+ true
++ ls /sys/class/
ls: cannot access '/sys/class/
+ bdev_stop=
+ '[' -n '' -a -e '' ']'
+ break
+ true
++ ls /sys/fs/
+ cdev_stop=
+ '[' -n /sys/fs/
+ echo 'writing 1 to /sys/fs/
writing 1 to /sys/fs/
+ echo 1
+ udevadm settle
+ sleep 1
+ true
++ ls '/sys/fs/
ls: cannot access '/sys/fs/
+ cdev_stop=
+ '[' -n '' -a -e '' ']'
+ break
+ (( x=0 ))
+ (( x<50 ))
+ wipefs -a /dev/sdc
/dev/sdc: 16 bytes were erased at offset 0x00001018 (bcache): c6 85 73 f6 4e 1a 45 ca 82 65 f5 7f 48 ba 6d 81
+ rc=0
+ '[' 0 = 0 ']'
+ break
+ '[' 0 '!=' 0 ']'
+ (( x=0 ))
+ (( x<50 ))
+ wipefs -a /dev/sdb
/dev/sdb: 16 bytes were erased at offset 0x00001018 (bcache): c6 85 73 f6 4e 1a 45 ca 82 65 f5 7f 48 ba 6d 81
+ rc=0
+ '[' 0 = 0 ']'
+ break
+ '[' 0 '!=' 0 ']'
+ make-bcache --wipe-bcache -C /dev/sdc -B /dev/sdb
UUID: 59306fe6-
Set UUID: 89103ca3-
version: 0
nbuckets: 20480
block_size: 1
bucket_size: 1024
nr_in_set: 1
nr_this_dev: 0
first_bucket: 1
UUID: 8b8fb68a-
Set UUID: 89103ca3-
version: 1
block_size: 1
data_offset: 16
+ udevadm settle --exit-if-exists /dev/bcache0
+ '[' '!' -e /dev/bcache/by-uuid ']'
+ ls -al /dev/bcache/
total 0
drwxr-xr-x 2 root root 60 Feb 4 23:30 .
drwxr-xr-x 3 root root 60 Feb 4 23:30 ..
lrwxrwxrwx 1 root root 13 Feb 4 23:30 8b8fb68a-
+ echo 'Creating filesystems on bcache0'
Creating filesystems on bcache0
+ mkfs.ext4 /dev/bcache0
mke2fs 1.45.3 (14-Jul-2019)
Discarding device blocks: done
Creating filesystem with 2621438 4k blocks and 655360 inodes
Filesystem UUID: 48988989-
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
+ echo 'mounting bcache0 to /mnt'
mounting bcache0 to /mnt
+ mount /dev/bcache0 /mnt
+ udevadm settle --exit-if...