Commit 7083e01b authored by Sochin Jiang's avatar Sochin Jiang Committed by Tomasz Zawadzki
Browse files

bdev/aio: access 'spdk_bdev_io' before 'spdk_bdev_io_complete' called



'spdk_bdev_io' could be freed after calling 'spdk_bdev_io_complete',
fix this potential issue in aio.

Signed-off-by: default avatarSochin Jiang <jiangxiaoqing.sochin@bytedance.com>
Change-Id: I2e67ec44d9ffc0dda4f5753beba06b8a249456ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5463


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
parent cac9322d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -341,8 +341,8 @@ bdev_aio_io_channel_poll(struct bdev_aio_io_channel *io_ch)
			status = SPDK_BDEV_IO_STATUS_SUCCESS;
		}

		spdk_bdev_io_complete(spdk_bdev_io_from_ctx(aio_task), status);
		aio_task->ch->io_inflight--;
		spdk_bdev_io_complete(spdk_bdev_io_from_ctx(aio_task), status);
	}

	return nr;