On Tue, 2019-12-10 at 12:57 -0500, Bart Van Assche wrote: > On 12/10/19 6:47 AM, Martin Wilck wrote: > > blk_mq_request_started() returns true for requests in > > MQ_RQ_COMPLETE > > state. Is this really an equivalent condition? > > > > That said, the condition in the current code is sort of strange, as > > it's equivalent to !(sp->completed && sp->aborted). I'm wondering > > what > > it means if a command is both completed and aborted. Naïvely > > thinking > > (and inferring from the current code) this condition could never be > > met, and thus its negation would hold for every command. Perhaps > > Quinn > > meant "!(sp->completed || sp->aborted)" ? > > Hi Martin, > > The only caller of qla2x00_abort_srb() is qla2x00_abort_all_cmds(). > That > function should only be called after completion interrupts have been > disabled. In other words, I don't think that we have to worry about > blk_mq_request_started() encountering the MQ_RQ_COMPLETE state. No > request should have that state when qla2x00_abort_all_cmds() is > called. I thought avoiding a race between completion and abort was the whole point of f45bca8c5052 ("scsi: qla2xxx: Fix double scsi_done for abort path"), which introduced the code that you're now changing. But I must be overlooking something then, as Himanshu has acked this. Martin