Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] libfc: fix exchange being deleted when the abort itself is timed out

Should not continue when the abort itself is being timeout since in that case
the exchange will be deleted and relesased. We still want to call the
associated response handler to let the layer, e.g., fcp, know the exchange
itself is being timed out.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Yi Zou and committed by
James Bottomley
ea3e2e72 d889b30a

+5 -2
+5 -2
drivers/scsi/libfc/fc_exch.c
··· 650 650 if (e_stat & ESB_ST_ABNORMAL) 651 651 rc = fc_exch_done_locked(ep); 652 652 spin_unlock_bh(&ep->ex_lock); 653 - if (!rc) 654 - fc_exch_delete(ep); 655 653 if (resp) 656 654 resp(sp, ERR_PTR(-FC_EX_TIMEOUT), arg); 655 + if (!rc) { 656 + /* delete the exchange if it's already being aborted */ 657 + fc_exch_delete(ep); 658 + return; 659 + } 657 660 fc_seq_exch_abort(sp, 2 * ep->r_a_tov); 658 661 goto done; 659 662 }