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:
parent
fa511620c4
commit
91b13bd105
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user