Spdk/test
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
..
app test: move lib/json up to test app directory 2018-03-29 00:31:24 -04:00
bdev bdev/qos: add the QoS setting in conf file 2018-04-03 19:36:58 -04:00
blobfs test: move test/lib/blobfs under test/blobfs 2018-03-23 19:45:09 -04:00
blobstore autotest_common.sh: move to test/common 2018-02-27 20:37:27 -05:00
common vm_setup: add new test flags to autorun-spdk.conf 2018-04-09 17:58:54 -04:00
cpp_headers build: add @: to remaining 'all' targets 2018-02-14 17:38:25 -05:00
env test: move lib/env up one level 2018-03-29 00:31:24 -04:00
event test: move lib/event up one directory 2018-03-29 00:31:24 -04:00
ioat test: move lib/ioat up one directory 2018-03-27 00:46:52 -04:00
iscsi_tgt test/iscsi: use veth interfaces instead of loopback 2018-04-10 11:40:38 -04:00
lvol test/lvol: sort test cases numerically 2018-04-06 12:20:07 -04:00
nvme test/nvme/aer: add an option to enable temperature tests 2018-04-09 16:36:06 -04:00
nvmf test/nvmf: identify NVM subsystem in kernel test 2018-04-06 18:30:58 -04:00
pmem bdev/pmem: change all NVML strings to PMDK 2018-04-07 00:07:57 -04:00
unit scsi: validate dev name length 2018-04-10 15:43:03 -04:00
vhost test/virtio: use "single file segments" 2018-04-03 18:57:29 -04:00
Makefile test: move lib/json up to test app directory 2018-03-29 00:31:24 -04:00
spdk_cunit.h scripts/check_format: check for spaces before tabs 2018-03-05 11:09:13 -05:00