Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2018-04-03 Thread Ryan Harper
Is this also fixed in bionic yet?

On Tue, Apr 3, 2018 at 9:10 AM, Launchpad Bug Tracker
<1729...@bugs.launchpad.net> wrote:
> This bug was fixed in the package linux - 4.13.0-38.43
>
> ---
> linux (4.13.0-38.43) artful; urgency=medium
>
>   * linux: 4.13.0-38.43 -proposed tracker (LP: #1755762)
>
>   * Servers going OOM after updating kernel from 4.10 to 4.13 (LP: #1748408)
> - i40e: Fix memory leak related filter programming status
> - i40e: Add programming descriptors to cleaned_count
>
>   * [SRU] Lenovo E41 Mic mute hotkey is not responding (LP: #1753347)
> - platform/x86: ideapad-laptop: Increase timeout to wait for EC answer
>
>   * fails to dump with latest kpti fixes (LP: #1750021)
> - kdump: write correct address of mem_section into vmcoreinfo
>
>   * headset mic can't be detected on two Dell machines (LP: #1748807)
> - ALSA: hda/realtek - Support headset mode for ALC215/ALC285/ALC289
> - ALSA: hda - Fix headset mic detection problem for two Dell machines
> - ALSA: hda - Fix a wrong FIXUP for alc289 on Dell machines
>
>   * CIFS SMB2/SMB3 does not work for domain based DFS (LP: #1747572)
> - CIFS: make IPC a regular tcon
> - CIFS: use tcon_ipc instead of use_ipc parameter of SMB2_ioctl
> - CIFS: dump IPC tcon in debug proc file
>
>   * i2c-thunderx: erroneous error message "unhandled state: 0" (LP: #1754076)
> - i2c: octeon: Prevent error message on bus error
>
>   * hisi_sas: Add disk LED support (LP: #1752695)
> - scsi: hisi_sas: directly attached disk LED feature for v2 hw
>
>   * EDAC, sb_edac: Backport 1 patch to Ubuntu 17.10 (Fix missing DIMM sysfs
> entries with KNL SNC2/SNC4 mode) (LP: #1743856)
> - EDAC, sb_edac: Fix missing DIMM sysfs entries with KNL SNC2/SNC4 mode
>
>   * [regression] Colour banding and artefacts appear system-wide on an Asus
> Zenbook UX303LA with Intel HD 4400 graphics (LP: #1749420)
> - drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA
>
>   * DVB Card with SAA7146 chipset not working (LP: #1742316)
> - vmalloc: fix __GFP_HIGHMEM usage for vmalloc_32 on 32b systems
>
>   * [Asus UX360UA] battery status in unity-panel is not changing when battery 
> is
> being charged (LP: #1661876) // AC adapter status not detected on Asus
> ZenBook UX410UAK (LP: #1745032)
> - ACPI / battery: Add quirk for Asus UX360UA and UX410UAK
>
>   * ASUS UX305LA - Battery state not detected correctly (LP: #1482390)
> - ACPI / battery: Add quirk for Asus GL502VSK and UX305LA
>
>   * support thunderx2 vendor pmu events (LP: #1747523)
> - perf pmu: Extract function to get JSON alias map
> - perf pmu: Pass pmu as a parameter to get_cpuid_str()
> - perf tools arm64: Add support for get_cpuid_str function.
> - perf pmu: Add helper function is_pmu_core to detect PMU CORE devices
> - perf vendor events arm64: Add ThunderX2 implementation defined pmu core
>   events
> - perf pmu: Add check for valid cpuid in perf_pmu__find_map()
>
>   * lpfc.ko module doesn't work (LP: #1746970)
> - scsi: lpfc: Fix loop mode target discovery
>
>   * Ubuntu 17.10 crashes on vmalloc.c (LP: #1739498)
> - powerpc/mm/book3s64: Make KERN_IO_START a variable
> - powerpc/mm/slb: Move comment next to the code it's referring to
> - powerpc/mm/hash64: Make vmalloc 56T on hash
>
>   * ethtool -p fails to light NIC LED on HiSilicon D05 systems (LP: #1748567)
> - net: hns: add ACPI mode support for ethtool -p
>
>   * CVE-2017-17807
> - KEYS: add missing permission check for request_key() destination
>
>   * [Artful SRU] Fix capsule update regression (LP: #1746019)
> - efi/capsule-loader: Reinstate virtual capsule mapping
>
>   * [Artful/Bionic] [Config] enable EDAC_GHES for ARM64 (LP: #1747746)
> - Ubuntu: [Config] enable EDAC_GHES for ARM64
>
>   * linux-tools: perf incorrectly linking libbfd (LP: #1748922)
> - SAUCE: tools -- add ability to disable libbfd
> - [Packaging] correct disablement of libbfd
>
>   * Cherry pick c96f5471ce7d for delayacct fix (LP: #1747769)
> - delayacct: Account blkio completion on the correct task
>
>   * Error in CPU frequency reporting when nominal and min pstates are same
> (cpufreq) (LP: #1746174)
> - cpufreq: powernv: Dont assume distinct pstate values for nominal and 
> pmin
>
>   * retpoline abi files are empty on i386 (LP: #1751021)
> - [Packaging] retpoline-extract -- instantiate retpoline files for i386
> - [Packaging] final-checks -- sanity checking ABI contents
> - [Packaging] final-checks -- check for empty retpoline files
>
>   * [P9,Power NV][WSP][Ubuntu 1804] : "Kernel access of bad area " when 
> grouping
> different pmu events using perf fuzzer . (perf:) (LP: #1746225)
> - powerpc/perf: Fix oops when grouping different pmu events
>
>   * bnx2x_attn_int_deasserted3:4323 MC assert! (LP: #1715519) //
> CVE-2018-126
> - net: create skb_gso_validate_mac_len()
> - bnx2x: 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2018-03-19 Thread Ryan Harper
Not sure if this was supposed to also be fixed in bionic-proposed yet,
but I assumed so and
it's not working there;  I'll test -proposed in artful and xenial next.

ubuntu@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu Bionic Beaver (development branch)"
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 4.15.0-13-generic #14-Ubuntu SMP Sat Mar 17 13:44:27 UTC
2018 x86_64 x86_64 x86_64 GNU/Linux

ubuntu@ubuntu:~$ apt-cache policy linux-image-virtual
linux-image-virtual:
  Installed: 4.15.0.13.14
  Candidate: 4.15.0.13.14
  Version table:
 *** 4.15.0.13.14 500
500 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
100 /var/lib/dpkg/status
 4.15.0.12.13 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 4.15.0-13-generic #14-Ubuntu SMP Sat Mar 17 13:44:27 UTC
2018 x86_64 x86_64 x86_64 GNU/Linux

ubuntu@ubuntu:~$ ls -al /dev/bcache*
brw-rw 1 root disk 251,   0 Mar 19 18:09 /dev/bcache0
brw-rw 1 root disk 251, 128 Mar 19 18:09 /dev/bcache1
brw-rw 1 root disk 251, 256 Mar 19 18:09 /dev/bcache2
brw-rw 1 root disk 251, 384 Mar 19 18:09 /dev/bcache3
ubuntu@ubuntu:~$ dmesg | grep bcache
[1.005037] bcache: register_bdev() registered backing device sdb
[1.011078] bcache: bch_journal_replay() journal replay done, 0
keys in 1 entries, seq 5
[1.023834] bcache: bch_cached_dev_attach() Caching sdb as bcache0
on set 0dbdcc17-7af0-4318-bd57-bbdf5c7f1bfa
[1.029237] bcache: register_cache() registered cache device sda
[1.029555] bcache: register_bdev() registered backing device sdd
[1.050543] bcache: bch_cached_dev_attach() Caching sdd as bcache1
on set 0dbdcc17-7af0-4318-bd57-bbdf5c7f1bfa
[1.052124] bcache: register_bdev() registered backing device sde
[1.054044] bcache: register_bdev() registered backing device sdf
[1.058398] bcache: bch_journal_replay() journal replay done, 0
keys in 1 entries, seq 5
[1.068618] bcache: bch_cached_dev_attach() Caching sdf as bcache3
on set d36b419d-a49d-42e2-95af-710138a20700
[1.070652] bcache: bch_cached_dev_attach() Caching sde as bcache2
on set d36b419d-a49d-42e2-95af-710138a20700
[1.076326] bcache: register_cache() registered cache device sdc
[4.090280] bcache: register_bcache() error /dev/sdc: device
already registered
[4.091070] bcache: register_bcache() error /dev/sdd: device
already registered
[4.094397] bcache: register_bcache() error /dev/sde: device
already registered
[4.095253] bcache: register_bcache() error /dev/sda: device
already registered
[4.103178] bcache: register_bcache() error /dev/sdb: device
already registered
[4.115378] bcache: register_bcache() error /dev/sdf: device
already registered

On Mon, Mar 19, 2018 at 5:56 AM, Stefan Bader
 wrote:
> This bug is awaiting verification that the kernel in -proposed solves
> the problem. Please test the kernel and update this bug with the
> results. If the problem is solved, change the tag 'verification-needed-
> artful' to 'verification-done-artful'. If the problem still exists,
> change the tag 'verification-needed-artful' to 'verification-failed-
> artful'.
>
> If verification is not done by 5 working days from today, this fix will
> be dropped from the source code, and this bug will be closed.
>
> See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
> to enable and use -proposed. Thank you!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145/+subscriptions

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Xenial:
  Fix Committed
Status in linux source package in Zesty:
  Won't Fix
Status in linux source package in Artful:
  Fix Committed
Status in linux source package in Bionic:
  In Progress

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
    Installed: 4.13.0-16.19
    Candidate: 4.13.0-16.19
    Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2018-02-16 Thread Ryan Harper
On Fri, Feb 16, 2018 at 12:14 PM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> @raharper,  I got side tracked and it got pushed down on my list.  I can
> still send it upstream if you want.  It's currently in Ubuntu as a SAUCE
> patch.
>

That would be great!
Thanks,


>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Xenial:
  Fix Committed
Status in linux source package in Zesty:
  Won't Fix
Status in linux source package in Artful:
  Fix Committed
Status in linux source package in Bionic:
  In Progress

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
    Installed: 4.13.0-16.19
    Candidate: 4.13.0-16.19
    Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  It appears that since the initramfs loads the bcache module which
  probes and finds all of the cache devices and backing devices then
  once the rootfs is mounted and udev gets to run, the bcache kernel
  module does not emit the CACHED_UUID value into the environment if the
  underlying devices are already registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
    register_bdev()
  bch_cached_dev_run()
    kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes:
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Nov  1 01:39:01 2017
  Ec2AMI: ami-030b
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.small
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
  Lsusb:
   Bus 001 Device 002: ID 0627:0001 Adomax 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-12 Thread Ryan Harper
On Tue, Dec 12, 2017 at 5:52 AM, Dimitri John Ledkov  wrote:

> Once the kernel is fixed, are there any changes that are required to
> systemd/udev?
>

No changes needed.


>
> ** Changed in: systemd (Ubuntu Bionic)
>Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  In Progress
Status in systemd package in Ubuntu:
  Incomplete
Status in linux source package in Xenial:
  In Progress
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  In Progress
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  In Progress
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  In Progress
Status in systemd source package in Bionic:
  Incomplete

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Nov  1 01:39:01 2017
  Ec2AMI: ami-030b
  

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-07 Thread Ryan Harper
Confirmed bionic works as expected.

I suspect you can send that upstream with my SoB faster than I can.
Definitely interested in seeing if they'll take something like that.

On Thu, Dec 7, 2017 at 1:21 PM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> Thanks for testing and the patch, Ryan.  I can submit and SRU request.
>
> We should also send this upstream for inclusion in the mainline kernel.
> Is that something you think you can do?  If not, I can do it for you.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-07 Thread Ryan Harper
Tested the xenial update.  I had one boot where the links didn't get
created, but I cannot recreate that issue now.

On Thu, Dec 7, 2017 at 9:56 AM, Ryan Harper 
wrote:

> Here's the Zesty test; all looks good.
>
> ubuntu@ubuntu:~$ cat /etc/cloud/build.info
> build_name: server
> serial: 20171207
> ubuntu@ubuntu:~$ uname -a
> Linux ubuntu 4.10.0-40-generic #44~lp1729145 SMP Wed Dec 6 16:21:45 UTC
> 2017 x86_64 x86_64 x86_64 GNU/Linux
> ubuntu@ubuntu:~$ tree /dev/bcache
> /dev/bcache [error opening dir]
>
> 0 directories, 0 files
>
> $ sudo dpkg --install linux-image-4.10.0-40-generic_
> 4.10.0-40.44~lp1729145_amd64.deb
> dpkg: warning: downgrading linux-image-4.10.0-40-generic from 4.10.0-40.44
> to 4.10.0-40.44~lp1729145
> (Reading database ... 56846 files and directories currently installed.)
> Preparing to unpack linux-image-4.10.0-40-generic_
> 4.10.0-40.44~lp1729145_amd64.deb ...
> Done.
> Unpacking linux-image-4.10.0-40-generic (4.10.0-40.44~lp1729145) over
> (4.10.0-40.44) ...
> Examining /etc/kernel/postrm.d .
> run-parts: executing /etc/kernel/postrm.d/initramfs-tools
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> run-parts: executing /etc/kernel/postrm.d/zz-update-grub
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> Setting up linux-image-4.10.0-40-generic (4.10.0-40.44~lp1729145) ...
> Running depmod.
> update-initramfs: deferring update (hook will be called later)
> Not updating initrd symbolic links since we are being updated/reinstalled
> (4.10.0-40.44 was configured last, according to dpkg)
> Not updating image symbolic links since we are being updated/reinstalled
> (4.10.0-40.44 was configured last, according to dpkg)
> Examining /etc/kernel/postinst.d.
> run-parts: executing /etc/kernel/postinst.d/apt-auto-removal
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> run-parts: executing /etc/kernel/postinst.d/initramfs-tools
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> update-initramfs: Generating /boot/initrd.img-4.10.0-40-generic
> W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
> run-parts: executing /etc/kernel/postinst.d/unattended-upgrades
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> run-parts: executing /etc/kernel/postinst.d/update-notifier
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> Searching for GRUB installation directory ... found: /boot/grub
> Searching for default file ... found: /boot/grub/default
> Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
> Searching for splash image ... none found, skipping ...
> Found kernel: /boot/vmlinuz-4.10.0-40-generic
> Found kernel: /boot/vmlinuz-4.10.0-40-generic
> Updating /boot/grub/menu.lst ... done
>
> run-parts: executing /etc/kernel/postinst.d/zz-update-grub
> 4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
> Generating grub configuration file ...
> Found linux image: /boot/vmlinuz-4.10.0-40-generic
> Found initrd image: /boot/initrd.img-4.10.0-40-generic
> done
> ubuntu@ubuntu:~$ sudo reboot
> ...
>
> ubuntu@ubuntu:~$ dpkg --list | grep linux-image
> ii  linux-image-4.10.0-40-generic  4.10.0-40.44~lp1729145
>  amd64Linux kernel image for version 4.10.0 on 64
> bit x86 SMP
> ii  linux-image-virtual4.10.0.40.40
>  amd64Virtual Linux kernel image
> ubuntu@ubuntu:~$ sudo tree /dev/bcache
> /dev/bcache
> ├── by-label
> │   ├── backing0 -> ../../bcache2
> │   └── backing1 -> ../../bcache0
> └── by-uuid
> ├── 1375d23f-4780-46d7-9fca-c397f8333685 -> ../../bcache3
> ├── 57e009b1-6bf4-42ea-abe0-334b10941a0b -> ../../bcache0
> ├── 7ce7dc32-7da9-42a8-899a-5d21ed7ea714 -> ../../bcache1
> └── 92d882d8-38cd-4537-847b-6f9c40ba67b4 -> ../../bcache2
>
> 2 directories, 6 files
>
>
> On Wed, Dec 6, 2017 at 11:00 AM, Joseph Salisbury <
> joseph.salisb...@canonical.com> wrote:
>
>> I built Xenial, Zesty and Bionic test kernels with your patch.  They can
>> also be downloaded from:
>>
>> http://kernel.ubuntu.com/~jsalisbury/lp1729145/
>>
>> Can those that can reproduce this bug give this test kernel a try?
>>
>>
>> Zesty required upstream commit 4b758df21 as a prereq.  Zesty never got
>> it, since upstream 4.10 is EOL.  Zesty would be the more important test
>> kernel to try due to this difference.
>>
>> Thanks again.
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1729145
>>
>> Title:
>>   /dev/bcache/by-uuid links not created after reboot
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
>> /+subscriptions
>>
>
>

-- 
You received this bug notification because you are a member of 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-07 Thread Ryan Harper
Here's the Zesty test; all looks good.

ubuntu@ubuntu:~$ cat /etc/cloud/build.info
build_name: server
serial: 20171207
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 4.10.0-40-generic #44~lp1729145 SMP Wed Dec 6 16:21:45 UTC
2017 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ubuntu:~$ tree /dev/bcache
/dev/bcache [error opening dir]

0 directories, 0 files

$ sudo dpkg --install
linux-image-4.10.0-40-generic_4.10.0-40.44~lp1729145_amd64.deb
dpkg: warning: downgrading linux-image-4.10.0-40-generic from 4.10.0-40.44
to 4.10.0-40.44~lp1729145
(Reading database ... 56846 files and directories currently installed.)
Preparing to unpack
linux-image-4.10.0-40-generic_4.10.0-40.44~lp1729145_amd64.deb ...
Done.
Unpacking linux-image-4.10.0-40-generic (4.10.0-40.44~lp1729145) over
(4.10.0-40.44) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.10.0-40-generic
/boot/vmlinuz-4.10.0-40-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.10.0-40-generic
/boot/vmlinuz-4.10.0-40-generic
Setting up linux-image-4.10.0-40-generic (4.10.0-40.44~lp1729145) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled
(4.10.0-40.44 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(4.10.0-40.44 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-40-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-4.10.0-40-generic
Found kernel: /boot/vmlinuz-4.10.0-40-generic
Updating /boot/grub/menu.lst ... done

run-parts: executing /etc/kernel/postinst.d/zz-update-grub
4.10.0-40-generic /boot/vmlinuz-4.10.0-40-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-40-generic
Found initrd image: /boot/initrd.img-4.10.0-40-generic
done
ubuntu@ubuntu:~$ sudo reboot
...

ubuntu@ubuntu:~$ dpkg --list | grep linux-image
ii  linux-image-4.10.0-40-generic  4.10.0-40.44~lp1729145
 amd64Linux kernel image for version 4.10.0 on 64
bit x86 SMP
ii  linux-image-virtual4.10.0.40.40
 amd64Virtual Linux kernel image
ubuntu@ubuntu:~$ sudo tree /dev/bcache
/dev/bcache
├── by-label
│   ├── backing0 -> ../../bcache2
│   └── backing1 -> ../../bcache0
└── by-uuid
├── 1375d23f-4780-46d7-9fca-c397f8333685 -> ../../bcache3
├── 57e009b1-6bf4-42ea-abe0-334b10941a0b -> ../../bcache0
├── 7ce7dc32-7da9-42a8-899a-5d21ed7ea714 -> ../../bcache1
└── 92d882d8-38cd-4537-847b-6f9c40ba67b4 -> ../../bcache2

2 directories, 6 files


On Wed, Dec 6, 2017 at 11:00 AM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> I built Xenial, Zesty and Bionic test kernels with your patch.  They can
> also be downloaded from:
>
> http://kernel.ubuntu.com/~jsalisbury/lp1729145/
>
> Can those that can reproduce this bug give this test kernel a try?
>
>
> Zesty required upstream commit 4b758df21 as a prereq.  Zesty never got it,
> since upstream 4.10 is EOL.  Zesty would be the more important test kernel
> to try due to this difference.
>
> Thanks again.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-05 Thread Ryan Harper
Thanks for doing the cleanup;  Patch looks good and I approve.

Signed-off-by: Ryan Harper 

On Tue, Dec 5, 2017 at 4:59 PM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> In the final patch we submit for SRU, it will also include your Signed-
> off-by, I just forgot to add it in the attached one.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Nov  1 01:39:01 2017
  

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-05 Thread Ryan Harper
Woot!

I think that did the trick.

ubuntu@ubuntu:~$ cat /etc/cloud/build.info
build_name: server
serial: 20171122
ubuntu@ubuntu:~$ lsb_release -rd
Description: Ubuntu 17.10
Release: 17.10
ubuntu@ubuntu:~$ set -o vi
ubuntu@ubuntu:~$ dpkg --list | grep linux-image
ii  linux-image-4.13.0-17-generic  4.13.0-17.20~lp1739145
 amd64Linux kernel image for version 4.13.0 on 64
bit x86 SMP
ii  linux-image-virtual4.13.0.17.18
 amd64Virtual Linux kernel image
ubuntu@ubuntu:~$ dpkg --list | grep bcache-tools
ii  bcache-tools   1.0.8-2build1
amd64bcache userspace tools

ubuntu@ubuntu:~$ sudo tree /dev/bcache
/dev/bcache
├── by-label
│   ├── backing0 -> ../../bcache1
│   └── backing1 -> ../../bcache0
└── by-uuid
├── 1375d23f-4780-46d7-9fca-c397f8333685 -> ../../bcache2
├── 57e009b1-6bf4-42ea-abe0-334b10941a0b -> ../../bcache0
├── 7ce7dc32-7da9-42a8-899a-5d21ed7ea714 -> ../../bcache3
└── 92d882d8-38cd-4537-847b-6f9c40ba67b4 -> ../../bcache1

2 directories, 6 files


On Tue, Dec 5, 2017 at 4:00 PM, Ryan Harper 
wrote:

> Thanks!  I'll give it a try today.
>
> On Tue, Dec 5, 2017 at 3:43 PM, Joseph Salisbury <
> joseph.salisb...@canonical.com> wrote:
>
>> I built an Artful test kernel with the path provided by Ryan.  The test
>> kernel can be downloaded from:
>>
>> http://kernel.ubuntu.com/~jsalisbury/lp1729145/
>>
>> Can those that can reproduce this bug give this test kernel a try?
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1729145
>>
>> Title:
>>   /dev/bcache/by-uuid links not created after reboot
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
>> /+subscriptions
>>
>
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-05 Thread Ryan Harper
Thanks!  I'll give it a try today.

On Tue, Dec 5, 2017 at 3:43 PM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> I built an Artful test kernel with the path provided by Ryan.  The test
> kernel can be downloaded from:
>
> http://kernel.ubuntu.com/~jsalisbury/lp1729145/
>
> Can those that can reproduce this bug give this test kernel a try?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Nov  1 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-04 Thread Ryan Harper
Looks like those two kfree's in dev_run can be dropped since that was an
exit after kmalloc'ing env entries which are now only done in

bch_cached_dev_emit_change()

which is only called by dev_run after it knows that the device is not
yet running.


On Mon, Dec 4, 2017 at 11:35 AM, Ryan Harper 
wrote:

> Hi Joseph,
>
> Sorry, I didn't give that a compile either; I just wanted to show what the
> change could look like;
> Let me see if I can get that to at least compile.
>
>
> On Mon, Dec 4, 2017 at 11:18 AM, Joseph Salisbury <
> joseph.salisb...@canonical.com> wrote:
>
>> It looks like env[] was declared in bch_cached_dev_emit_change(), but
>> not in bch_cached_dev_run().
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1729145
>>
>> Title:
>>   /dev/bcache/by-uuid links not created after reboot
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
>> /+subscriptions
>>
>
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-12-04 Thread Ryan Harper
Hi Joseph,

Sorry, I didn't give that a compile either; I just wanted to show what the
change could look like;
Let me see if I can get that to at least compile.


On Mon, Dec 4, 2017 at 11:18 AM, Joseph Salisbury <
joseph.salisb...@canonical.com> wrote:

> It looks like env[] was declared in bch_cached_dev_emit_change(), but
> not in bch_cached_dev_run().
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then is that only a kernel call to bch_cached_dev_run()
  which happens like this:

  bcache_register()
register_bdev()
  bch_cached_dev_run()
kobject_uevent_env(_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);

  where env includes: 
  "DRIVER=bcache",
  kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid),
  NULL,
  NULL,
  };

  Since that event is not emitted for any previously registered device,
  then the symlink will not be created.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-image-4.13.0-16-generic 4.13.0-16.19
  ProcVersionSignature: User Name 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  AlsaDevices:
   total 0
   crw-rw 1 root audio 116,  1 Oct 31 22:09 seq
   crw-rw 1 root audio 116, 33 Oct 31 22:09 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
  ApportVersion: 2.20.7-0ubuntu3.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 
'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Nov  1 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-11-30 Thread Ryan Harper
Dec 01 05:07:25.679368 ubuntu systemd-udevd[474]: LINK
'disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869'
/lib/udev/rules.d/60-persistent-storage.rules:79
Dec 01 05:07:25.683008 ubuntu systemd-udevd[474]: WARK:
dev_old_name=/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4
dev_old_path=/devices/virtual/block/bcache0
Dec 01 05:07:25.683042 ubuntu systemd-udevd[474]: WARK:
dev_name=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869
dev_path=/devices/virtual/block/bcache0
Dec 01 05:07:25.683066 ubuntu systemd-udevd[474]: WARK:
streq(name=/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4,
name_current=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869)
Dec 01 05:07:25.683076 ubuntu systemd-udevd[474]: update old name,
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4' no longer
belonging to '/devices/virtual/block/bcache0'
Dec 01 05:07:25.683085 ubuntu systemd-udevd[474]: WARK:
link_update(name=/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4,
false
Dec 01 05:07:25.683094 ubuntu systemd-udevd[474]: no reference left, remove
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4'
Dec 01 05:07:25.683104 ubuntu systemd-udevd[474]: WARK:
dev_old_name=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869
dev_old_path=/devices/virtual/block/bcache0
Dec 01 05:07:25.683113 ubuntu systemd-udevd[474]: WARK:
dev_name=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869
dev_path=/devices/virtual/block/bcache0
Dec 01 05:07:25.683122 ubuntu systemd-udevd[474]: WARK:
streq(name=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869,
name_current=/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869)
Dec 01 05:07:25.683131 ubuntu systemd-udevd[474]: WARK: found match!
continue
Dec 01 05:07:25.683146 ubuntu systemd-udevd[474]: handling device node
'/dev/bcache0', devnum=b250:0, mode=0660, uid=0, gid=6
Dec 01 05:07:25.683155 ubuntu systemd-udevd[474]: set permissions
/dev/bcache0, 060660, uid=0, gid=6
Dec 01 05:07:25.683165 ubuntu systemd-udevd[474]: preserve already existing
symlink '/dev/block/250:0' to '../bcache0'
Dec 01 05:07:25.683174 ubuntu systemd-udevd[474]: found 'b250:0' claiming
'/run/udev/links/\x2fdisk\x2fby-uuid\x2f0a270acb-56b8-4498-8bad-b3bb149fe869'
Dec 01 05:07:25.683183 ubuntu systemd-udevd[474]: creating link
'/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to '/dev/bcache0'
Dec 01 05:07:25.683193 ubuntu systemd-udevd[474]: preserve already existing
symlink '/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to
'../../bcache0'
Dec 01 05:07:25.683201 ubuntu systemd-udevd[474]: created db file
'/run/udev/data/b250:0' for '/devices/virtual/block/bcache0'
Dec 01 05:07:25.683211 ubuntu systemd[1]:
dev-disk-by\x2duuid-0a270acb\x2d56b8\x2d4498\x2d8bad\x2db3bb149fe869.device:
Changed dead -> plugged
Dec 01 05:07:25.683226 ubuntu systemd[1]: dev-bcache0.device: Changed dead
-> plugged
Dec 01 05:07:25.683234 ubuntu systemd[1]:
sys-devices-virtual-block-bcache0.device: Changed dead -> plugged


The new dev (from /deb/bcache0) only has a by-uuid devlink as the UEVENT
that generates the CACHED_UUID devlink is not recorded/discovered
after the original binding of the cache device and backing store.  This
forces udev to remove the link.

I hacked in a change which allows the old link to stay if the old_name, or
old_path match; this
keeps the symlinks around.

This is required (or the kernel fix to emit the CACHED_UUID on cold plug);
but not sufficient.
What else is needed is a change to the bcache rules file such that when a
bcacheN device is
replugged, it will query the backing device's superblock to find out the
dev.uuid, and import that
value as CACHED_UUID so that the dname rule can match the path
/dev/bcache/by-uuid/ and dname
will point to that, which abstracts away whether it points to bcache0, 1 ,
or N.

/dev/disk/by-dname/foo -> ../../../bcache/by-uuid/  ->
../../bcacheN



On Thu, Nov 30, 2017 at 7:16 PM, Ryan Harper 
wrote:

> It looks like there is some ordering issues:
>
> This is a grep through /run/udev/links ; these are checked by udev-dev
>
> # find . -name 'b250*'
> ./\x2fdisk\x2fby-uuid\x2f0a270acb-56b8-4498-8bad-b3bb149fe869/b250:1
> ./\x2fdisk\x2fby-uuid\x2f92b0868d-7e56-4956-8e55-2c90ebee4a72/b250:0
> ./\x2fbcache\x2fby-uuid\x2f92d882d8-38cd-4537-847b-6f9c40ba67b4/b250:1
> ./\x2fbcache\x2fby-uuid\x2f57e009b1-6bf4-42ea-abe0-334b10941a0b/b250:0
>
> So both /dev/bcache/by-uuid and /dev/disk/by-uuid both point to the bcache
> device (b250:0)
>
> udevd shows this:
>
> Nov 30 23:39:10.738290 ubuntu systemd-udevd[465]: LINK
> 'disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' /lib/udev/rules.d/60-
> persistent-storage.rules:79
> Nov 30 23:39:10.738304 ubuntu systemd-udevd[465]: update old name,
> '/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4' no longer
> belonging to '/devices/virtual/block/bcache1'
> Nov 30 23:39:10.738321 ubuntu systemd-udevd[465]: no reference left,
> remove 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-11-30 Thread Ryan Harper
It looks like there is some ordering issues:

This is a grep through /run/udev/links ; these are checked by udev-dev

# find . -name 'b250*'
./\x2fdisk\x2fby-uuid\x2f0a270acb-56b8-4498-8bad-b3bb149fe869/b250:1
./\x2fdisk\x2fby-uuid\x2f92b0868d-7e56-4956-8e55-2c90ebee4a72/b250:0
./\x2fbcache\x2fby-uuid\x2f92d882d8-38cd-4537-847b-6f9c40ba67b4/b250:1
./\x2fbcache\x2fby-uuid\x2f57e009b1-6bf4-42ea-abe0-334b10941a0b/b250:0

So both /dev/bcache/by-uuid and /dev/disk/by-uuid both point to the bcache
device (b250:0)

udevd shows this:

Nov 30 23:39:10.738290 ubuntu systemd-udevd[465]: LINK
'disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869'
/lib/udev/rules.d/60-persistent-storage.rules:79
Nov 30 23:39:10.738304 ubuntu systemd-udevd[465]: update old name,
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4' no longer
belonging to '/devices/virtual/block/bcache1'
Nov 30 23:39:10.738321 ubuntu systemd-udevd[465]: no reference left, remove
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4'
Nov 30 23:39:10.738361 ubuntu systemd-udevd[465]: found 'b250:1' claiming
'/run/udev/links/\x2fdisk\x2fby-uuid\x2f0a270acb-56b8-4498-8bad-b3bb149fe869'
Nov 30 23:39:10.738370 ubuntu systemd-udevd[465]: creating link
'/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to '/dev/bcache1'
Nov 30 23:39:10.738380 ubuntu systemd-udevd[465]: preserve already existing
symlink '/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to
'../../bcache1'
Nov 30 23:39:10.743215 ubuntu systemd-udevd[487]: LINK
'disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72'
/lib/udev/rules.d/60-persistent-storage.rules:79
Nov 30 23:39:10.743228 ubuntu systemd-udevd[487]: update old name,
'/dev/bcache/by-uuid/57e009b1-6bf4-42ea-abe0-334b10941a0b' no longer
belonging to '/devices/virtual/block/bcache0'
Nov 30 23:39:10.743247 ubuntu systemd-udevd[487]: no reference left, remove
'/dev/bcache/by-uuid/57e009b1-6bf4-42ea-abe0-334b10941a0b'
Nov 30 23:39:10.743291 ubuntu systemd-udevd[487]: found 'b250:0' claiming
'/run/udev/links/\x2fdisk\x2fby-uuid\x2f92b0868d-7e56-4956-8e55-2c90ebee4a72'
Nov 30 23:39:10.743302 ubuntu systemd-udevd[487]: creating link
'/dev/disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72' to '/dev/bcache0'
Nov 30 23:39:10.743312 ubuntu systemd-udevd[487]: preserve already existing
symlink '/dev/disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72' to
'../../bcache0'

It would seem that the 'no longer belonging to ...bcache1' is the trigger
for the removal
however, 250:1 is indeed bcache1 device.


# ls -al /dev/bcache1
brw-rw 1 root disk 250, 1 Nov 30 23:39 /dev/bcache1

Looking at the systemd/udev/udev-event.c it appears that for entries in
the current udev database that don't have a new event associated with them
get the call to remove the old link

void udev_event_execute_rules()
  ...
  if (major(udev_device_get_devnum(dev)) > 0) {
bool apply;

/* remove/update possible left-over symlinks from
old database entry */
if (event->dev_db != NULL)
udev_node_update_old_links(dev,
event->dev_db);


Will need to crawl through the db to see what the the event->dev_db entry
is and where that get's set.


On Thu, Nov 30, 2017 at 2:41 PM, Dmitrii Shcherbakov <
1729...@bugs.launchpad.net> wrote:

> Looks like masking systemd-udevd removes this behavior. Need to figure
> out where it actually clears everything out.
>
> ubuntu@maas-xenial4:~$ sudo systemctl mask systemd-udevd
> 11:32 PM Created symlink from /etc/systemd/system/systemd-udevd.service
> to /dev/null.
>
> # reboot
>
> ubuntu@maas-xenial4:~$ ls /dev/bcache/by-uuid/
> 2963855b-3d2b-4387-abd1-3ae788919de4  727212eb-0f0b-4d20-9191-f0577a38454e
> 835afacf-6213-48a9-864c-43733822668b  aa04ab39-a42c-446f-aff5-addbd9c80e06
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy 

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-11-30 Thread Ryan Harper
Investigating why /dev doesn't have the correct links even if they're
present led me to look at
/usr/share/initramfs-tools/scripts/init-bottom/udev (provided via the udev
dpkg from systemd)

In there, the mount -n -o move is used to migrate the /dev from initramfs
to the rootfs/dev

This bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844775

Indicated that the initramfs may have util-linux version of mount which
needs to use
mount --move  instead.  This is addressed in newer systemd packages (in
bionic for sure)

And the mount line now looks like this:


# move the /dev tmpfs to the rootfs; fall back to util-linux mount that does
# not understand -o move
mount -n -o move /dev ${rootmnt}/dev || mount -n --move /dev ${rootmnt}/dev

Let's see if that helps resolve the "missing" symlinks.


On Thu, Nov 30, 2017 at 10:27 AM, Ryan Harper 
wrote:

> So, /dev/bcache/by-uuid is not getting created.
>
> That's the same kernel bug I filed.
>
> And, if they were, I think they'd get moved properly.
>
> init-bottom/udev script does the following:
>
> # Stop udevd, we'll miss a few events while we run init, but we catch up
> udevadm control --exit
>
> # move the /dev tmpfs to the rootfs
> mount -n -o move /dev ${rootmnt}/dev
>
> That "move" operation migrates the entire mounted directory to a new
> location
> so, if /dev/bcache/by-uuid  existed, it would be present when systemd init
> runs.
>
> AFAICT, there's not fix here without the kernel side.
>
> On Thu, Nov 30, 2017 at 10:09 AM, Dmitrii Shcherbakov <
> 1729...@bugs.launchpad.net> wrote:
>
>> Just in case also checked with this rule that creates links at /dev
>> /dev/disk/by-uuid /dev/bcache/by-uuid https://paste.ubuntu.com/26081756/
>>
>> They are all there originally (see the screenshot).
>>
>> But not there afterwards. So it's not just a problem with a different
>> path.
>>
>> https://paste.ubuntu.com/26081775/
>>
>> ubuntu@maas-xenial4:~$ tree /dev/ | grep bcache
>> ├── bcache0
>> ├── bcache1
>> ├── bcache2
>> ├── bcache3
>> │   ├── 251:0 -> ../bcache0
>> │   ├── 251:1 -> ../bcache1
>> │   ├── 251:2 -> ../bcache2
>> │   ├── 251:3 -> ../bcache3
>> │   │   ├── bcache0 -> ../../bcache0
>> │   │   ├── bcache1 -> ../../bcache1
>> │   │   ├── bcache2 -> ../../bcache2
>> │   │   ├── bcache3 -> ../../bcache3
>>
>>
>> ** Attachment added: "bcache-multiple-links.png"
>>https://bugs.launchpad.net/ubuntu/+source/linux/+bug/172914
>> 5/+attachment/5016592/+files/bcache-multiple-links.png
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1729145
>>
>> Title:
>>   /dev/bcache/by-uuid links not created after reboot
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
>> /+subscriptions
>>
>
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [

Re: [Kernel-packages] [Bug 1729145] Re: /dev/bcache/by-uuid links not created after reboot

2017-11-30 Thread Ryan Harper
So, /dev/bcache/by-uuid is not getting created.

That's the same kernel bug I filed.

And, if they were, I think they'd get moved properly.

init-bottom/udev script does the following:

# Stop udevd, we'll miss a few events while we run init, but we catch up
udevadm control --exit

# move the /dev tmpfs to the rootfs
mount -n -o move /dev ${rootmnt}/dev

That "move" operation migrates the entire mounted directory to a new
location
so, if /dev/bcache/by-uuid  existed, it would be present when systemd init
runs.

AFAICT, there's not fix here without the kernel side.

On Thu, Nov 30, 2017 at 10:09 AM, Dmitrii Shcherbakov <
1729...@bugs.launchpad.net> wrote:

> Just in case also checked with this rule that creates links at /dev
> /dev/disk/by-uuid /dev/bcache/by-uuid https://paste.ubuntu.com/26081756/
>
> They are all there originally (see the screenshot).
>
> But not there afterwards. So it's not just a problem with a different
> path.
>
> https://paste.ubuntu.com/26081775/
>
> ubuntu@maas-xenial4:~$ tree /dev/ | grep bcache
> ├── bcache0
> ├── bcache1
> ├── bcache2
> ├── bcache3
> │   ├── 251:0 -> ../bcache0
> │   ├── 251:1 -> ../bcache1
> │   ├── 251:2 -> ../bcache2
> │   ├── 251:3 -> ../bcache3
> │   │   ├── bcache0 -> ../../bcache0
> │   │   ├── bcache1 -> ../../bcache1
> │   │   ├── bcache2 -> ../../bcache2
> │   │   ├── bcache3 -> ../../bcache3
>
>
> ** Attachment added: "bcache-multiple-links.png"
>https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+attachment/5016592/+files/bcache-multiple-links.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
>   /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>

-- 
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/1729145

Title:
  /dev/bcache/by-uuid links not created after reboot

Status in linux package in Ubuntu:
  Triaged
Status in systemd package in Ubuntu:
  New
Status in linux source package in Xenial:
  Triaged
Status in systemd source package in Xenial:
  New
Status in linux source package in Zesty:
  Triaged
Status in systemd source package in Zesty:
  New
Status in linux source package in Artful:
  Triaged
Status in systemd source package in Artful:
  New
Status in linux source package in Bionic:
  Triaged
Status in systemd source package in Bionic:
  New

Bug description:
  1. $ lsb_release -rd
  Description:  Ubuntu 17.10
  Release:  17.10

  2. $ apt-cache policy linux-image-`uname -r`
  linux-image-4.13.0-16-generic:
Installed: 4.13.0-16.19
Candidate: 4.13.0-16.19
Version table:
   *** 4.13.0-16.19 500
  500 http://nova.clouds.archive.ubuntu.com/ubuntu artful/main amd64 
Packages
  100 /var/lib/dpkg/status

  3. After creating some bcache devices and rebooting 
/dev/bcache/by-uuid/ -> ../../bcacheN
  symlinks point to the current bcache device which is caching the dev.uuid 
found after creating a backing device.

  4. /dev/bcache/by-uuid does not exist and there are not symlinks
  underneath

  
  It appears that since the initramfs loads the bcache module which probes and 
finds all of the cache devices and backing devices then once the rootfs is 
mounted and udev gets to run, the bcache kernel module does not emit the 
CACHED_UUID value into the environment if the underlying devices are already 
registered.

  In dmesg, one can see that prior to mounting the rootfs, we see bcache
  register events:

  [5.333973] bcache: register_bdev() registered backing device vdb2
  [5.354138] bcache: register_bdev() registered backing device vdb4
  [5.365665] bcache: register_bdev() registered backing device vdb3
  [5.397720] bcache: bch_journal_replay() journal replay done, 0 keys in 1 
entries, seq 1
  [5.428683] bcache: register_cache() registered cache device vdb1

  then rootfs ismounted and systemd starts systemd-udev

  [9.350889] systemd[1]: Listening on udev Kernel Socket.

  And then the coldplug replay of kernel events triggers 
/lib/udev/rules.d/69-bcache.rules
  which invokes /lib/udev/bcache-register which writes the device name 
(/dev/vdb1 or /dev/bcache0) into /sys/fs/bcache/register and results is the 
bcache kernel driver attempting to register the block device.  However, there 
is already a bcache device associated already and registration fails

  [   11.173141] bcache: register_bcache() error opening /dev/vdb2: device 
already registered
  [   11.184617] bcache: register_bcache() error opening /dev/vdb3: device 
already registered
  [   11.199130] bcache: register_bcache() error opening /dev/vdb1: device 
already registered
  [   11.271694] bcache: register_bcache() error opening /dev/vdb4: device 
already registered

  The problem then