From patchwork Wed Mar 18 00:12:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dev, Vasu" X-Patchwork-Id: 6035491 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0682E9F314 for ; Wed, 18 Mar 2015 00:12:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 453A520435 for ; Wed, 18 Mar 2015 00:12:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47FAC203C3 for ; Wed, 18 Mar 2015 00:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbbCRAMJ (ORCPT ); Tue, 17 Mar 2015 20:12:09 -0400 Received: from mga14.intel.com ([192.55.52.115]:2322 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752963AbbCRAMI (ORCPT ); Tue, 17 Mar 2015 20:12:08 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 17 Mar 2015 17:06:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,418,1422950400"; d="scan'208";a="666684617" Received: from lin-nd1-054.jf.intel.com ([10.166.48.54]) by orsmga001.jf.intel.com with ESMTP; 17 Mar 2015 17:12:07 -0700 From: Vasu Dev Subject: [PATCH] libfc: abort an exchange in case of underrun error To: linux-scsi@vger.kernel.org Cc: fcoe-devel@open-fcoe.org Date: Tue, 17 Mar 2015 17:12:07 -0700 Message-ID: <20150318001207.11827.82460.stgit@lin-nd1-054.jf.intel.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently exchange is not aborted in case underrun, so this patch fixes this by issuing exchange abort along FC_DATA_UNDRUN error since such error-ed exchange must be aborted first before same can be re-used. Tested-By: Jack Morgan Signed-off-by: Vasu Dev --- drivers/scsi/libfc/fc_fcp.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index c679594..9ad1248 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -959,8 +959,10 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp) if (fsp->cdb_status == SAM_STAT_GOOD && fsp->xfer_len < fsp->data_len && !fsp->io_status && (!(fsp->scsi_comp_flags & FCP_RESID_UNDER) || - fsp->xfer_len < fsp->data_len - fsp->scsi_resid)) + fsp->xfer_len < fsp->data_len - fsp->scsi_resid)) { fsp->status_code = FC_DATA_UNDRUN; + fc_fcp_send_abort(fsp); + } } seq = fsp->seq_ptr;