bdev/fio: always set the engine_data to NULL

When initiating the io_u strcture from FIO, always
set the engine_data to NULL first as the io_u structure
is just malloced from FIO without specifically setting
to zero.

In the io_u free path, the engine_data field is checked
whether to NULL or not. To avoid mischeck issue, explicitly
set the engine_data to NULL at the beginning of the io_u
init path.

Change-Id: I52c8c251f36925650a44d14e35781bd8494ff358
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472916
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
GangCao 2019-10-31 17:33:36 -04:00 committed by Tomasz Zawadzki
parent 3c84535d69
commit fcf4c5e426
2 changed files with 4 additions and 0 deletions

View File

@ -538,6 +538,8 @@ spdk_fio_io_u_init(struct thread_data *td, struct io_u *io_u)
{
struct spdk_fio_request *fio_req;
io_u->engine_data = NULL;
fio_req = calloc(1, sizeof(*fio_req));
if (fio_req == NULL) {
return 1;

View File

@ -537,6 +537,8 @@ static int spdk_fio_io_u_init(struct thread_data *td, struct io_u *io_u)
struct spdk_fio_thread *fio_thread = td->io_ops_data;
struct spdk_fio_request *fio_req;
io_u->engine_data = NULL;
fio_req = calloc(1, sizeof(*fio_req));
if (fio_req == NULL) {
return 1;