bdev/ocf: Fix set_data callback's data pointer check
The function returns -ENOBUFS when handling OCF_WRITE_FLUSH requests on a disk with a size which its lower 32-bits are zeros. Zeroing the request buffer length occurs when creating a new ocf_io and assigning a 64-bit value to a 32-bit value in vbdev_ocf.c:io_handle. This patch fixes the condition to check if the request have a payload (data->iovs) before checking for the size limitation. Signed-off-by: Gal Hammer <gal.hammer@huawei.com> Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com> Change-Id: I2c6d03fee32a8fbed7beffdac6fef6a478ea4211 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10896 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Rafal Stefanowski <rafal.stefanowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
b090172f53
commit
a2340f36fa
@ -88,7 +88,8 @@ vbdev_ocf_volume_io_set_data(struct ocf_io *io, ctx_data_t *data,
|
||||
io_ctx->offset = offset;
|
||||
io_ctx->data = data;
|
||||
|
||||
if (io_ctx->data && offset >= io_ctx->data->size) {
|
||||
assert(io_ctx->data != NULL);
|
||||
if (io_ctx->data->iovs && offset >= io_ctx->data->size) {
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user