numam-spdk/lib/scsi
Daniel Verkamp af9c9a415a scsi: validate dev name length
Instead of silently truncating overly-long SCSI dev names, add an
explicit check and return an error if the name is too long.

Since we now calculate the length of name up front, this also allows
simplification of the copy into dev->name.

This also ensures that dev->name will always be zero-terminated, so we
can simplify the strnlen() in spdk_bdev_scsi_pad_scsi_name() to a
strlen() and remove the invalid unit test case for padding names longer
than SPDK_SCSI_DEV_MAX_NAME.

Change-Id: I54de00bac062a142a10c41cfa2aec19d7969dff0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406990
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 15:43:03 -04:00
..
dev.c scsi: validate dev name length 2018-04-10 15:43:03 -04:00
lun.c io_channel: add return value to pollers 2018-03-13 11:16:20 -04:00
Makefile scsi: remove lun_db 2018-01-09 13:56:00 -05:00
port.c scsi: remove port from scsi_dev dynamically 2017-10-12 15:46:14 -04:00
scsi_bdev.c scsi: validate dev name length 2018-04-10 15:43:03 -04:00
scsi_internal.h scripts/check_format: check for spaces before tabs 2018-03-05 11:09:13 -05:00
scsi_rpc.c scsi: remove lun_db 2018-01-09 13:56:00 -05:00
scsi.c log: rename SPDK_TRACE_* to SPDK_LOG_* 2017-12-07 12:23:19 -05:00
task.c scsi, iscsi: move task->parent to iSCSI task 2018-01-05 00:01:37 -05:00