diff options
author | Vasu Dev <vasu.dev@intel.com> | 2011-05-16 16:45:45 -0700 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 12:37:03 -0400 |
commit | 8d23f4ba38f399a6169613c6f158e39691aa694f (patch) | |
tree | 5cd9af9ddded978f659e4662f76043f726781883 /drivers/scsi/libfc/fc_exch.c | |
parent | 6a716a8535ea8ed7676cea1e122f1c3d02e55b6b (diff) | |
download | linux-8d23f4ba38f399a6169613c6f158e39691aa694f.tar.bz2 |
[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>
Diffstat (limited to 'drivers/scsi/libfc/fc_exch.c')
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 4d2994d38fb9..3b8a6451ea28 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -1434,6 +1434,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) (f_ctl & (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) == (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) { spin_lock_bh(&ep->ex_lock); + resp = ep->resp; rc = fc_exch_done_locked(ep); WARN_ON(fc_seq_exch(sp) != ep); spin_unlock_bh(&ep->ex_lock); |