]> git.ipfire.org Git - thirdparty/mdadm.git/commit
imsm: retrieve nvme serial from sysfs
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Thu, 6 Oct 2016 09:13:09 +0000 (11:13 +0200)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 7 Oct 2016 15:18:32 +0000 (11:18 -0400)
commit21e9380b26058762a0d3cb0957c5808736d21996
treed2e4ce16ef028f1fe6a9a586edae29234408793b
parentfa219dd26aa498f3e446798b7b341e8e4a29d378
imsm: retrieve nvme serial from sysfs

Don't rely on SCSI ioctl for reading NVMe serials - SCSI emulation for
NVMe devices can be disabled in the kernel config. Instead, try to get a
serial from /sys/block/nvme*/device/serial. If that fails for whatever
reason (i.e. no such attribute in old kernels) - fall back to the SCSI
method.

This also moves some SCSI-specific code from imsm_read_serial() to
scsi_get_serial().

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Reviewed-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
sg_io.c
super-intel.c