scsi: don't change bdev_io status in spdk_scsi_task_put()

The SCSI task bdev I/O should never be pending when spdk_scsi_task_put()
is called, and just setting the status to failed is not correct (when
the bdev eventually completes the I/O, it will write into the now-freed
bdev_io, which may be reused by someone else).

Change-Id: Iaad6ce9ab41539652abc40147fed47c5012109dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2017-05-04 12:31:57 -07:00
parent fa511620c4
commit 91b13bd105
2 changed files with 1 additions and 4 deletions

View File

@ -838,6 +838,7 @@ spdk_bdev_free_io(struct spdk_bdev_io *bdev_io)
if (bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING) {
SPDK_ERRLOG("bdev_io is in pending state\n");
assert(false);
return -1;
}

View File

@ -55,10 +55,6 @@ spdk_scsi_task_put(struct spdk_scsi_task *task)
}
if (bdev_io) {
/* due to lun reset, the bdev_io status could be pending */
if (bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING) {
bdev_io->status = SPDK_BDEV_IO_STATUS_FAILED;
}
spdk_bdev_free_io(bdev_io);
}