mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
nvme: print namespace IDs as unsigned 32bit value
NSIDs are 32-bit unsigned values, but a number of log messages print them with %d. An NSID larger than 0x7fffffff is rendered as a negative number, which is confusing in the kernel log and makes the message hard to correlate with the namespace it talks about. Sparse NSID spaces where high NSIDs are common are the most likely to hit this. The nsid sysfs attribute has the same problem, and there it is worse because userspace parses the value. For example: $ grep . /sys/class/block/nvme0*/nsid /sys/class/block/nvme0c0n1/nsid:10 /sys/class/block/nvme0c0n2/nsid:-16 /sys/class/block/nvme0c0n3/nsid:11 /sys/class/block/nvme0c0n4/nsid:-2000000016 /sys/class/block/nvme0n1/nsid:10 /sys/class/block/nvme0n2/nsid:-16 /sys/class/block/nvme0n3/nsid:11 /sys/class/block/nvme0n4/nsid:-2000000016 $ Print all of them with %u. Several messages in these files, including two in zns.c right next to the ones being changed, already use %u, so this only makes the rest consistent with them. No functional change other than how the NSID is formatted. Fixes:2b9b6e86bc("NVMe: Export namespace attributes to sysfs") Fixes:1d5df6af8c("nvme: don't blindly overwrite identifiers on disk revalidate") Fixes:ed754e5dee("nvme: track shared namespaces") Fixes:9ad1927a3b("nvme: always search for namespace head") Fixes:71010c3094("nvme: implement multiple I/O Command Set support") Fixes:2f4c9ba23b("nvme: export zoned namespaces without Zone Append support read-only") Fixes:0ec84df495("nvme-core: check ctrl css before setting up zns") Fixes:2079f41ec6("nvme: check that EUI/GUID/UUID are globally unique") Fixes:ce8d78616a("nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH") Fixes:ac522fc6c3("nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices") Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
4ed7f3d7d4
commit
b2d8f2a372
3 changed files with 12 additions and 12 deletions
Loading…
Add table
Add a link
Reference in a new issue