Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Rework the struct scsi_device inquiry information
@ 2026-05-15 20:52 Bart Van Assche
  2026-05-15 20:52 ` [PATCH v2 1/3] scsi: core, target: Add INQUIRY-related constants into <scsi/scsi_common.h> Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2026-05-15 20:52 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Brian Bunker, Damien Le Moal, Hannes Reinecke,
	Bart Van Assche

Hi Martin,

The vendor, model and rev members in struct scsi_device are fixed-length
strings that are not NUL-terminated. This patch converts these members into
NUL-terminated character arrays. This makes it less error-prone to deal with
these structure members. The patches in this series have been implemented such
that the number of lines changed and the risk for regressions is minimized.

Please consider this patch series for the next merge window.

Thanks,

Bart.

Changes compared to v1:
 - Added symbolic constants for the offsets in patch 1/3.
 - Added a new patch 2/3.
 - Converted one strscpy() call into a memcpy() call in patch 3/3 because the
   strscpy() call triggers a KASAN read-out-of-bounds complaint.

Bart Van Assche (3):
  scsi: core, target: Add INQUIRY-related constants into
    <scsi/scsi_common.h>
  scsi: core: Use the INQUIRY-related constants
  scsi: core: Convert INQUIRY information

 drivers/hwmon/drivetemp.c         |  5 +----
 drivers/scsi/scsi_scan.c          | 33 ++++++++++++++++++++-----------
 include/scsi/scsi_common.h        |  8 ++++++++
 include/scsi/scsi_device.h        |  7 ++++---
 include/target/target_core_base.h |  5 +----
 5 files changed, 36 insertions(+), 22 deletions(-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-15 20:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 20:52 [PATCH v2 0/3] Rework the struct scsi_device inquiry information Bart Van Assche
2026-05-15 20:52 ` [PATCH v2 1/3] scsi: core, target: Add INQUIRY-related constants into <scsi/scsi_common.h> Bart Van Assche
2026-05-15 20:52 ` [PATCH v2 2/3] scsi: core: Use the INQUIRY-related constants Bart Van Assche
2026-05-15 20:52 ` [PATCH v2 3/3] scsi: core: Convert INQUIRY information Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox