export nvme drive model/serial strings via sysfs (trusty)

Bug #1649635 reported by Dan Streetman on 2016-12-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Dan Streetman
Trusty
Undecided
Dan Streetman

Bug Description

[Impact]

Without the model and serial strings for each nvme drive exported via sysfs, udev cannot create the /dev/disk/by-id/ symlinks, since it can't access the model/serial info. Without these symlinks, it's difficult to uniquely identify a specific nvme drive.

[Test Case]

The udev rules to create the nvme symlinks need updating, per bug 1642903 and bug 1647485. With the udev package updated with fixes/workarounds from those bugs, boot a kernel without this patch on a system with nvme drive(s), and check the /dev/disk/by-id/ directory; no symlinks to the nvme drives should be present. With this kernel patch, check the directory, and symlinks to all nvme drives and their partitions should be present, in the form of /dev/disk/by-id/nvme-MODEL_SERIAL for the drive and /dev/disk/by-id/nvme-MODEL_SERIAL-partN for each partition.

[Regression Potential]

Creating/managing sysfs files can result in problems ranging from memory leaks to a kernel oops, if not managed correctly.

[Other Info]

This functionality is present in upstream kernels, but the change diff between this kernel version and where this functionality appears upstream is massive - the driver changes from manually managing its userspace access over to using the standard device infrastructure, as well as numerous other bugfixes and feature changes. So instead of attempting to backport all those changes, this patch retains only a small part of the upstream patch and adds direct sysfs file creation using device_create_file(), which the upstream code never did. This is by far the simplest way to update this very old kernel with the functionality.

Dan Streetman (ddstreet) wrote :

This is relevant for trusty only; the nvme driver in xenial and later already exports the model/serial strings via sysfs.

Changed in linux (Ubuntu):
assignee: nobody → Dan Streetman (ddstreet)
summary: - export nvme drive model/serial strings via sysfs
+ export nvme drive model/serial strings via sysfs (trusty)

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1649635

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: trusty
Luis Henriques (henrix) on 2016-12-15
Changed in linux (Ubuntu Trusty):
status: New → Fix Committed
Luis Henriques (henrix) 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-trusty' to 'verification-done-trusty'. If the problem still exists, change the tag 'verification-needed-trusty' to 'verification-failed-trusty'.

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!

tags: added: verification-needed-trusty
Dan Streetman (ddstreet) wrote :

verified with kernel 3.13.0-106-generic, the model, serial, and firmware_rev files in sysfs are not present, and with kernel 3.13.0-107-generic (from -proposed) the model, serial, and firmware_rev files are present, and they contain the expected strings.

ddstreet@test:/sys/block$ uname -a
Linux test 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ddstreet@test:/sys/block$ ls -d nvme?n?
nvme0n1 nvme0n2 nvme0n3 nvme0n4
ddstreet@test:/sys/block$ ls -l nvme?n?/device/{model,serial,firmware_rev}
ls: cannot access nvme?n?/device/model: No such file or directory
ls: cannot access nvme?n?/device/serial: No such file or directory
ls: cannot access nvme?n?/device/firmware_rev: No such file or directory

ddstreet@test:/sys/block$ uname -a
Linux test 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ddstreet@test:/sys/block$ ls -d nvme?n?
nvme0n1 nvme0n2 nvme0n3 nvme0n4
ddstreet@test:/sys/block$ ls -l nvme?n?/device/{model,serial,firmware_rev}
-r--r--r-- 1 root root 4096 Dec 22 16:50 nvme0n1/device/firmware_rev
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n1/device/model
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n1/device/serial
-r--r--r-- 1 root root 4096 Dec 22 16:50 nvme0n2/device/firmware_rev
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n2/device/model
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n2/device/serial
-r--r--r-- 1 root root 4096 Dec 22 16:50 nvme0n3/device/firmware_rev
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n3/device/model
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n3/device/serial
-r--r--r-- 1 root root 4096 Dec 22 16:50 nvme0n4/device/firmware_rev
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n4/device/model
-r--r--r-- 1 root root 4096 Dec 22 16:47 nvme0n4/device/serial

tags: added: verification-done-trusty
removed: verification-needed-trusty
Changed in linux (Ubuntu Trusty):
assignee: nobody → Dan Streetman (ddstreet)
Po-Hsu Lin (cypressyew) on 2016-12-29
Changed in linux (Ubuntu):
status: Incomplete → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.13.0-107.154

---------------
linux (3.13.0-107.154) trusty; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1651197

  * CVE-2016-9756
    - KVM: x86: drop error recovery in em_jmp_far and em_ret_far

  * CVE-2016-9806
    - netlink: Fix dump skb leak/double free

  * CVE-2016-9794
    - ALSA: pcm : Call kill_fasync() in stream lock

  * export nvme drive model/serial strings via sysfs (trusty) (LP: #1649635)
    - NVMe: Export NVMe attributes to sysfs group

  * CVE-2016-9793
    - net: avoid signed overflows for SO_{SND|RCV}BUFFORCE

  * Ubuntu16.10 - EEH on BELL3 adapter fails to recover (serial/tty)
    (LP: #1646857)
    - serial: 8250_pci: Detach low-level driver during PCI error recovery

 -- Luis Henriques <email address hidden> Mon, 19 Dec 2016 18:09:38 +0000

Changed in linux (Ubuntu Trusty):
status: Fix Committed → Fix Released
Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers