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

IB/iser: Handle aborting a command after it is sent

The SCSI midlayer may abort a command that was already sent. If the
initiator is still trying to send the command (or data-out PDUs for
that command), the QP may time out after the midlayer times
out. Therefore, when aborting the command, iSER may still have
references for the command's buffers. When sending these PDUs, the
sends will complete with an error and their resources will be released
then.

Signed-off-by: Erez Zilber <erezz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Erez Zilber and committed by
Roland Dreier
3104a217 0264d885

+9 -8
+9 -8
drivers/infiniband/ulp/iser/iser_initiator.c
··· 658 658 { 659 659 int deferred; 660 660 int is_rdma_aligned = 1; 661 + struct iser_regd_buf *regd; 661 662 662 663 /* if we were reading, copy back to unaligned sglist, 663 664 * anyway dma_unmap and free the copy ··· 673 672 } 674 673 675 674 if (iser_ctask->dir[ISER_DIR_IN]) { 676 - deferred = iser_regd_buff_release 677 - (&iser_ctask->rdma_regd[ISER_DIR_IN]); 675 + regd = &iser_ctask->rdma_regd[ISER_DIR_IN]; 676 + deferred = iser_regd_buff_release(regd); 678 677 if (deferred) { 679 - iser_err("References remain for BUF-IN rdma reg\n"); 680 - BUG(); 678 + iser_err("%d references remain for BUF-IN rdma reg\n", 679 + atomic_read(&regd->ref_count)); 681 680 } 682 681 } 683 682 684 683 if (iser_ctask->dir[ISER_DIR_OUT]) { 685 - deferred = iser_regd_buff_release 686 - (&iser_ctask->rdma_regd[ISER_DIR_OUT]); 684 + regd = &iser_ctask->rdma_regd[ISER_DIR_OUT]; 685 + deferred = iser_regd_buff_release(regd); 687 686 if (deferred) { 688 - iser_err("References remain for BUF-OUT rdma reg\n"); 689 - BUG(); 687 + iser_err("%d references remain for BUF-OUT rdma reg\n", 688 + atomic_read(&regd->ref_count)); 690 689 } 691 690 } 692 691