From patchwork Sat Aug 13 00:10:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Reed X-Patchwork-Id: 1666024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=t0ALvFaO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4M4LYh0c83z9sGS for ; Sat, 13 Aug 2022 10:11:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oMekC-0007Op-Co; Sat, 13 Aug 2022 00:11:12 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oMek6-0007Ki-2A for kernel-team@lists.ubuntu.com; Sat, 13 Aug 2022 00:11:06 +0000 Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 776B73F0E1 for ; Sat, 13 Aug 2022 00:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1660349465; bh=je0snfJaQQ5skSoRcJ05l17ZCrb3Ae5MkrxZn5FU5gc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=t0ALvFaO3aQ6C8AUjEDFMzaxgKAbeV6PCrw3WcD9PvrVLX7+0tpX85lSZmCoDnzZC l8oJkgmmpKnqAjAR2k/5oPHUE2RrioYP99fqDN4OMRMJSINvwOzT8JTo5MUAIUR/64 mAnF2n8b6niKp5XWKNkG7idLCWxoop3Q91I967O8B6DhJa3UcE8rjyZ9Fc3Mzg4AlE 7l4/YNWcav7vf3x6uiBYKXX4TyX+HWU2iHrnMuI4a6Gu8dgsbCmDHead6SyWL1ERwW UYTkNltsCgntudVtWLFW74+ZdH+XTffF6FGyZNfQGzSxX2wvl4OxFvqivmAHnrQBcK Mg9LS4LhzC6xg== Received: by mail-oi1-f198.google.com with SMTP id bb10-20020a056808168a00b00342d91dd857so857236oib.21 for ; Fri, 12 Aug 2022 17:11:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=je0snfJaQQ5skSoRcJ05l17ZCrb3Ae5MkrxZn5FU5gc=; b=dG2mLbyoKPsrtiONuJFbsgEQmRJTLyWZdzg/vagSaVW/jy30UvDAs5N2gNDf7yS0zr uXj2mbIsP8BhTuPL/dTaAY0Zq/t5vnKdViEWPR50oQaKOjoOy+gXq6Y9sbFCMVezIYvM 8eH7Na+GJAT1uVYm9mu6PZNuPUUqmSXHG55ZshWY4gziIAIV36aORFXMXa9+UtUJPHiA tZRWg96bYqvwv3bOuLJb4mhW2sw9jGgHTB9B3MebCJ9H5xurbQB3fgbI++aYS2KKbpN9 U6i5XoLDqFMlTB+gV7p7cFqf3IJbIP3v76CXtEBwVwjsTIEzGX04xr6OIHu+tcgdCdCK A3Og== X-Gm-Message-State: ACgBeo3oB5RxC44ceMPu2xBNN1TG1HBl2zvUWANMl6VavtuDhXKXxWai REYqcwQfieDXUeUAW/zpGw2QkjbzRiDhJ/Cj6Nf4WFyqSYSBaS4sn2Cbr/1WSXh+PUgHpod0Rrm 2VLKTbA1s9Wk0L+lM1ldw0hSBLYqFe76Yef8Hx+nEtg== X-Received: by 2002:a9d:6494:0:b0:61c:c1ba:c302 with SMTP id g20-20020a9d6494000000b0061cc1bac302mr2357978otl.70.1660349464303; Fri, 12 Aug 2022 17:11:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6uLmG1j0zu7PjaZUyQuoWyuySOFITGLC+vajMds351NQ+EHDcaPU/kKkdjk4FkmbaaNlwFxg== X-Received: by 2002:a9d:6494:0:b0:61c:c1ba:c302 with SMTP id g20-20020a9d6494000000b0061cc1bac302mr2357967otl.70.1660349464036; Fri, 12 Aug 2022 17:11:04 -0700 (PDT) Received: from localhost ([2600:1700:1d0:5e50:51b0:150c:5b8d:e224]) by smtp.gmail.com with ESMTPSA id v83-20020aca6156000000b0033b15465357sm605545oib.5.2022.08.12.17.11.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 17:11:03 -0700 (PDT) From: Michael Reed To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH 4/5] scsi: fnic: Set scsi_set_resid() only for underflow Date: Fri, 12 Aug 2022 19:10:56 -0500 Message-Id: <20220813001057.34877-5-michael.reed@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220813001057.34877-1-michael.reed@canonical.com> References: <20220813001057.34877-1-michael.reed@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Karan Tilak Kumar Set scsi_set_resid() only if FCPIO_ICMND_CMPL_RESID_UNDER is set. BugLink: https://launchpad.net/bugs/1984011 Link: https://lore.kernel.org/r/20201121015134.18872-1-kartilak@cisco.com Reviewed-by: Arulprabhu Ponnusamy Co-developed-by: Satish Kharat Signed-off-by: Satish Kharat Signed-off-by: Karan Tilak Kumar Signed-off-by: Martin K. Petersen (cherry picked from commit 74ae6d6a6805f9fe162e4527d8ff0f7d2f9bc0d0) Signed-off-by: Michael Reed --- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_scsi.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h index 7c5c911b2673..e4d399f41a0a 100644 --- a/drivers/scsi/fnic/fnic.h +++ b/drivers/scsi/fnic/fnic.h @@ -39,7 +39,7 @@ #define DRV_NAME "fnic" #define DRV_DESCRIPTION "Cisco FCoE HBA Driver" -#define DRV_VERSION "1.6.0.51" +#define DRV_VERSION "1.6.0.52" #define PFX DRV_NAME ": " #define DFX DRV_NAME "%d: " diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 9b23f9701f91..486ff8a18a37 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -920,10 +920,11 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, case FCPIO_SUCCESS: sc->result = (DID_OK << 16) | icmnd_cmpl->scsi_status; xfer_len = scsi_bufflen(sc); - scsi_set_resid(sc, icmnd_cmpl->residual); - if (icmnd_cmpl->flags & FCPIO_ICMND_CMPL_RESID_UNDER) + if (icmnd_cmpl->flags & FCPIO_ICMND_CMPL_RESID_UNDER) { xfer_len -= icmnd_cmpl->residual; + scsi_set_resid(sc, icmnd_cmpl->residual); + } if (icmnd_cmpl->scsi_status == SAM_STAT_CHECK_CONDITION) atomic64_inc(&fnic_stats->misc_stats.check_condition);