Spdk/test
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
..
app test: Don't set max_reactor_delay in bdev_svc 2019-02-14 14:58:56 +00:00
bdev bdevio: fix opts.name 2019-02-25 07:06:04 +00:00
blobfs app/parse: add default return value for app parse function 2019-01-22 01:03:39 +00:00
blobstore histograms: tests for bdev histograms 2019-01-24 21:50:18 +00:00
common scripts: vm_setup.sh fix OCF github repo path 2019-02-21 18:02:11 +00:00
config_converter config_converter: Remove deprecated construct_nvmf_subsystem RPC 2019-01-29 16:17:03 +00:00
cpp_headers build: don't include spdk.app.mk in test/cpp_headers 2018-12-12 22:35:21 +00:00
env env/dpdk: allow changing DPDK loglevels 2019-02-22 08:49:45 +00:00
event test, nvmf: remove last usages of max_delay_us 2019-02-13 16:43:18 +00:00
ftl test/ftl: Remove deprecated max_delay parameter from tests 2019-02-20 21:30:29 +00:00
ioat ioat: remove ioat kperf kernel driver test harness 2018-04-30 17:11:53 +00:00
iscsi_tgt test/iscsi_tgt: Use rpc instead of config file. 2019-02-22 18:28:25 +00:00
json_config test:increase the json_config.sh shutdown app timeout value 2019-02-22 09:55:03 +00:00
lvol lvol: exposed marking lvol bdev as read only 2019-01-18 19:02:36 +00:00
nvme test/nvmf/nvme-cli: don't run nvme-cli as secondary process 2019-01-29 20:54:13 +00:00
nvmf test/nvmf: move connect_disconnect to NIGHTLY_FAILING 2019-02-21 20:03:04 +00:00
ocf OCF: rpc: add get_ocf_bdevs method 2019-01-28 18:53:31 +00:00
pmem test: consolidate tests for reading JSON config 2019-01-16 14:17:10 +00:00
rpc_client jsonrpc: add connection close callback 2019-01-10 14:31:37 +00:00
spdkcli QoS/Bdev: add the Read/Write separate bandwidth rate limits 2019-01-22 23:21:43 +00:00
unit bdev: Not assert but pass completion status to spdk_bdev_io_get_buf_cb 2019-02-27 01:59:11 +00:00
vhost test/vhost: add windows filesystem test 2019-02-25 23:16:44 +00:00
Makefile jsonrpc-client: add new C client library 2018-10-11 20:07:44 +00:00
spdk_cunit.h test: remove leftover spdk_cunit declaration 2018-07-06 22:47:56 +00:00