af9c9a415a
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> |
||
---|---|---|
.. | ||
dev.c | ||
lun.c | ||
Makefile | ||
port.c | ||
scsi_bdev.c | ||
scsi_internal.h | ||
scsi_rpc.c | ||
scsi.c | ||
task.c |