[SCSI] bfa: fix possible IO double completion
authorJing Huang <huangj@brocade.com>
Fri, 9 Jul 2010 02:58:45 +0000 (19:58 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 27 Jul 2010 17:04:20 +0000 (12:04 -0500)
commit56d218fc93ede28a2a5b71c5db334f193b39988f
treecc0868699c656cdb93380ba20467c8ae5bf7e516
parentdb954c04cbebd7d719927118c7f58eddd8dd9913
[SCSI] bfa: fix possible IO double completion

While processing the ioim in callback functions, the ioim is still in io_q.
During this time, if the itnim goes offline, the ioim is requeued from
itnim->io_q into itnim->delay_comp_q although the request is already completed.
This results in requeing the ioim into the callback queue if the ioim is not
freed by the time the ioim is requeued. This results in double completion of
the ioim. To fix this, whenever a response is received from firmware for an
ioim, deque it from io_q and enque to fcpim->comp_q. This will eliminate any
possibility of itnim picking any ioim for which the response is already
received.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bfa/bfa_ioim.c