diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2018-09-11 19:18:23 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-09-12 02:28:10 +0200 |
commit | d594db018792f3f6990455cbf33d31dd3c707b38 (patch) | |
tree | e71a06918bcbd3d78cc9e64541828f26eab3731d /drivers/scsi/qla2xxx/qla_target.h | |
parent | scsi: qla2xxx: Reject bsg request if chip is down. (diff) | |
download | linux-d594db018792f3f6990455cbf33d31dd3c707b38.tar.xz linux-d594db018792f3f6990455cbf33d31dd3c707b38.zip |
scsi: qla2xxx: Fix premature command free
When qla2xxx and Target Core gets out of sync during command cleanup, qla2xxx
will not free command until it is out of firmware's hand and Target Core has
called the release on the command.
This patch adds synchronization using cmd_lock and release flag. If the
release flag is set, then qla2xxx will free up the command using
qlt_free_cmd() otherwise transport_generic_free_cmd() will be responsible for
relase of the command.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 6a59c99a63da..91403269b204 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h @@ -900,6 +900,7 @@ struct qla_tgt_cmd { unsigned int aborted:1; unsigned int data_work:1; unsigned int data_work_free:1; + unsigned int released:1; struct scatterlist *sg; /* cmd data buffer SG vector */ int sg_cnt; /* SG segments count */ |