aboutsummaryrefslogtreecommitdiff
path: root/include/linux/fpga
diff options
context:
space:
mode:
authorMing Lei <[email protected]>2021-09-06 14:50:03 +0800
committerJens Axboe <[email protected]>2021-09-12 19:32:43 -0600
commit67f3b2f822b7e71cfc9b42dbd9f3144fa2933e0b (patch)
treedb190218a57bbeb6efbe1e3c8105f65cc91fe933 /include/linux/fpga
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f (diff)
blk-mq: avoid to iterate over stale request
blk-mq can't run allocating driver tag and updating ->rqs[tag] atomically, meantime blk-mq doesn't clear ->rqs[tag] after the driver tag is released. So there is chance to iterating over one stale request just after the tag is allocated and before updating ->rqs[tag]. scsi_host_busy_iter() calls scsi_host_check_in_flight() to count scsi in-flight requests after scsi host is blocked, so no new scsi command can be marked as SCMD_STATE_INFLIGHT. However, driver tag allocation still can be run by blk-mq core. One request is marked as SCMD_STATE_INFLIGHT, but this request may have been kept in another slot of ->rqs[], meantime the slot can be allocated out but ->rqs[] isn't updated yet. Then this in-flight request is counted twice as SCMD_STATE_INFLIGHT. This way causes trouble in handling scsi error. Fixes the issue by not iterating over stale request. Cc: [email protected] Cc: "Martin K. Petersen" <[email protected]> Reported-by: luojiaxing <[email protected]> Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux/fpga')
0 files changed, 0 insertions, 0 deletions