Commit 91b13bd1 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent fa511620
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}

+0 −4
Original line number Diff line number Diff line
@@ -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);
		}