diff --git a/lib/bdev/iscsi/bdev_iscsi.c b/lib/bdev/iscsi/bdev_iscsi.c index 288aea8756..6a13a836bd 100644 --- a/lib/bdev/iscsi/bdev_iscsi.c +++ b/lib/bdev/iscsi/bdev_iscsi.c @@ -227,7 +227,7 @@ bdev_iscsi_command_cb(struct iscsi_context *context, int status, void *_task, vo struct scsi_task *task = _task; struct bdev_iscsi_io *iscsi_io = _iscsi_io; - iscsi_io->scsi_status = task->status; + iscsi_io->scsi_status = status; iscsi_io->sk = (uint8_t)task->sense.key; iscsi_io->asc = (task->sense.ascq >> 8) & 0xFF; iscsi_io->ascq = task->sense.ascq & 0xFF; @@ -491,6 +491,8 @@ static void bdev_iscsi_submit_request(struct spdk_io_channel *_ch, struct spdk_b iscsi_io->submit_td = submit_td; spdk_thread_send_msg(lun->master_td, _bdev_iscsi_submit_request, bdev_io); return; + } else { + iscsi_io->submit_td = NULL; } _bdev_iscsi_submit_request(bdev_io);