Spdk/test/unit/lib
Shuhei Matsumoto 4b92ffb3f1 bdev: Not assert but pass completion status to spdk_bdev_io_get_buf_cb
When the specified buffer size to spdk_bdev_io_get_buf() is greater
than the permitted maximum, spdk_bdev_io_get_buf() asserts simply and
doesn't call the specified callback function.

SPDK SCSI library doesn't allocate read buffer and specifies
expected read buffer size, and expects that it is allocated by
spdk_bdev_io_get_buf().

Bdev perf tool also doesn't allocate read buffer and specifies
expected read buffer size, and expects that it is allocated by
spdk_bdev_io_get_buf().

When we support DIF insert and strip in iSCSI target, the read
buffer size iSCSI initiator requests and the read buffer size iSCSI target
requests will become different.

Even after that, iSCSI initiator and iSCSI target will negotiate correctly
not to cause buffer overflow in spdk_bdev_io_get_buf(), but if iSCSI
initiator ignores the result of negotiation, iSCSI initiator can request
read buffer size larger than the permitted maximum, and can cause
failure in iSCSI target. This is very flagile and should be avoided.

This patch do the following
- Add the completion status of spdk_bdev_io_get_buf() to
  spdk_bdev_io_get_buf_cb(),
- spdk_bdev_io_get_buf() calls spdk_bdev_io_get_buf_cb() by setting
  success to false, and return.
- spdk_bdev_io_get_buf_cb() in each bdev module calls assert if success
  is false.

Subsequent patches will process the case that success is false
in spdk_bdev_io_get_buf_cb().

Change-Id: I76429a86e18a69aa085a353ac94743296d270b82
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/446045
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-02-27 01:59:11 +00:00
..
bdev bdev: Not assert but pass completion status to spdk_bdev_io_get_buf_cb 2019-02-27 01:59:11 +00:00
blob thread: Optionally allow the current time to be passed to 2019-02-11 22:58:45 +00:00
blobfs thread: Optionally allow the current time to be passed to 2019-02-11 22:58:45 +00:00
event test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
ftl test/unit/ftl: Fix assert in write pointer test 2019-02-26 07:51:20 +00:00
ioat test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
iscsi test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
json json: add utilities function enabling itaration over JSON object 2018-10-18 16:07:37 +00:00
jsonrpc jsonrpc: fix received JSON buffer overwrite 2019-01-10 14:31:37 +00:00
log test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
lvol test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
nvme nvme: make the completion status string accessible from external applications 2019-02-15 21:11:28 +00:00
nvmf NVMe-oF: add asserts for SGE counts 2019-02-12 23:34:20 +00:00
reduce test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
scsi scsi: Use spdk_bdev_writev_blocks instead of spdk_bdev_writev 2019-02-20 20:17:56 +00:00
sock test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
thread test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
util ut/dif: fix iov memory over-allocation 2019-02-25 03:03:36 +00:00
vhost rte_vhost: introduce get/set vring base idx APIs 2019-02-27 01:43:16 +00:00
json_mock.c subsystem: add per module configuration dump 2018-03-23 02:47:40 -04:00
Makefile ftl: Added unit tests for FTL library 2019-01-22 23:22:16 +00:00