+28
−3
Loading
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>