b860c8dbce
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_gpt_submti_request() calls spdk_bdev_io_get_buf() when the I/O is read, and its callback vbdev_gpt_get_buf_cb calls _vbdev_gpt_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: Ifb2eac500276ab5012123b7d6f7eb033d87ad17c Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461350 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> |
||
---|---|---|
.. | ||
gpt.c | ||
gpt.h | ||
Makefile | ||
vbdev_gpt.c |