# Re: \[PATCH\] imsm: retrieve nvme serial from sysfs

- From: Jes Sorensen \<hidden\>
- Date: 2016-10-07 15:19:00 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2016/10/6633037
- Thread: https://ratatoskr.run/linux-raid/2016/10/6633037/t.md

```text
Artur Paszkiewicz [ref] writes:
> 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 <redacted>
> Reviewed-by: Tomasz Majchrzak <redacted>
> Reviewed-by: Alexey Obitotskiy <redacted>
> ---
>  sg_io.c       | 23 +++++++++++++++++++----
>  super-intel.c | 46 +++++++++++++++++++++++++++-------------------
>  2 files changed, 46 insertions(+), 23 deletions(-)

Hi Artur,

Looks quite reasonable - applied!

Thanks,
Jes
```
