Spdk/lib/bdev/split
Shuhei Matsumoto 25532d08f8 bdev/split: call get buffer function before forwarding read I/O to the base bdev
iSCSI target does not allocate data buffer on read, and delegate
allocation to the bdev.

When the bdev is a split vbdev, the split vbdev does not allocate
data buffer and delegate allocation to the backend bdev.

In this case, iSCSI target expects the buffer is allocated until
notifying completion to the split vbdev. However, the split vbdev
notifies completion to the backend bdev when calling the callback
of iSCSI target. The backend bdev frees the buffer immediately,
but iSCSI target still uses the buffer. If the buffer is reused
by another I/O, data corruption will occur.

For this issue, vbdev_split_submti_request() calls
spdk_bdev_io_get_buf() when the I/O is read, and its callback
vbdev_split_get_buf_cb calls _vbdev_split_submit_request() then.

This will ensure the buffer is allocated before forwarding I/O
to the backed bdev.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icfd0663b548479ac0bf6b5b49420f144142e3300
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461348
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-12 02:25:57 +00:00
..
Makefile bdev: remove "v" prefix from vbdev library names 2018-11-01 21:25:55 +00:00
vbdev_split_rpc.c misc/rpc: rename some C functions of rpc methods 2019-05-07 05:30:16 +00:00
vbdev_split.c bdev/split: call get buffer function before forwarding read I/O to the base bdev 2019-07-12 02:25:57 +00:00
vbdev_split.h bdev: Use not C++ style comments // but C-style comments /* */ 2018-10-31 22:01:47 +00:00