linux/include
Igor Pylypiv 94c125bafa scsi: core: Add 'serial' sysfs attribute for SCSI/SATA
Add a 'serial' sysfs attribute for SCSI and SATA devices. This attribute
exposes the Unit Serial Number, which is derived from the Device
Identification Vital Product Data (VPD) page 0x80.

Whitespace is stripped from the retrieved serial number to handle the
different alignment (right-aligned for SCSI, potentially left-aligned for
SATA). As noted in SAT-5 10.5.3, "Although SPC-5 defines the PRODUCT SERIAL
NUMBER field as right-aligned, ACS-5 does not require its SERIAL NUMBER
field to be right-aligned. Therefore, right-alignment of the PRODUCT SERIAL
NUMBER field for the translation is not assured."

This attribute is used by tools such as lsblk to display the serial number
of block devices.

[mkp: length adjustment]

Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://patch.msgid.link/20260209212151.342151-1-ipylypiv@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-28 20:03:00 -05:00
..
acpi mailbox: platform and core updates 2026-02-14 11:13:32 -08:00
asm-generic hyperv-next for v7.0 2026-02-20 08:48:31 -08:00
clocksource
crypto Networking changes for 7.0 2026-02-11 19:31:52 -08:00
cxl
drm drm/pagemap: pass pagemap_addr by reference 2026-02-17 19:39:44 -05:00
dt-bindings phy-for-7.0 2026-02-17 11:40:04 -08:00
hyperv hyperv-next for v7.0 2026-02-20 08:48:31 -08:00
keys
kunit treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
kvm
linux fsverity fixes for v7.0-rc1 2026-02-22 13:12:04 -08:00
math-emu
media [GIT PULL for v7.0] media updates 2026-02-11 12:20:25 -08:00
memory
misc
net Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
pcmcia
ras
rdma RDMA v7.0 merge window 2026-02-12 17:05:20 -08:00
rv rv: Fix multiple definition of __pcpu_unique_da_mon_this 2026-02-20 13:12:00 +01:00
scsi scsi: core: Add 'serial' sysfs attribute for SCSI/SATA 2026-02-28 20:03:00 -05:00
soc
sound
target
trace vfs-7.0-rc1.misc.2 2026-02-16 13:00:36 -08:00
uapi drm next fixes for 7.0-rc1 2026-02-20 15:36:38 -08:00
ufs
vdso
video
xen
Kbuild