]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] libfc: don't call resp handler after FC_EX_TIMEOUT
authorVasu Dev <vasu.dev@intel.com>
Mon, 16 May 2011 23:45:45 +0000 (16:45 -0700)
committerJames Bottomley <jbottomley@parallels.com>
Tue, 24 May 2011 16:37:03 +0000 (12:37 -0400)
commit809998a73f75db65eaa3592ab9a11b963ab0fa0e
tree5cd9af9ddded978f659e4662f76043f726781883
parentf7f5b4ed4b4cd79c0642ce070f262fbd9404195a
[SCSI] libfc: don't call resp handler after FC_EX_TIMEOUT

In cases exch is already timed out then exch layer could
end up calling resp handler again for its response frame
received after timeout, though in this case fc_exch_timeout
handler would have already called resp with FC_EX_TIMEOUT.

This would cause REC response handler to release its
fsp pkt hold twice instead once and possibly similar issues
with other ELS exchanges in this race.

To avoid this race have resp updated under exch lock
in rx path, the resp would get set to NULL in case
of FC_EX_TIMEOUT under the same lock to prevent resp
callback after FC_EX_TIMEOUT.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
drivers/scsi/libfc/fc_exch.c