Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp717972ybb; Sat, 28 Mar 2020 08:26:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuJhK/N7DaTTqdARErao4yyJM8l5XA03qpepCWV40JHrsNCikqzJ9ggZF1PF0MCja1uLGFx X-Received: by 2002:aca:c70f:: with SMTP id x15mr2577404oif.80.1585409186078; Sat, 28 Mar 2020 08:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585409186; cv=none; d=google.com; s=arc-20160816; b=1KKQpQNo2aPagiiB7HfCb0frS0yhRkglFsUZl2h2bUuipCATQQ2kUW6uuDuQKZIzWK g9Fi1eQzLVFKeQlwWbVK2fWqnE/HRAy6yYtadyJOz6RPyTkF+DLCe9IAQKRmy0VCK7gt yriyddx4p+NJIL3ttPQQMfMT87D3Yt0FO1tjEQGgZS6MUhcVh4sjCe8lLn+Yp4tjmMj7 hdDiw9EwUbe9vMd7EUyS4Z87y5T+Okeq2Kv6EUMPU9hWakim3eip7XwpE5EmfKnL8O1p FqMhcyptX1O4S/deOp2WZWDnjsxxMt4EBqFEVtQ3z6w96rFgMrWeAO2m9IGzGJfoWLFt XKtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=12aEMbTslAn/G1qRsVLvEzy/UtMD0VbPt0+kyPKOz5w=; b=xwB/Ju8RsSNFgj9pdSKgHHOCdrazemgPiCpoRyzxAOVBu5XECrpJGZoSUpUtNFMmmJ CDHb/jVELb1sIw8u7RIwyOBeobGQHA8I5+y/tEDdvvUqgeph58eAiVr5x2PbPOSVUg+h xQTHTBlaw3GE+TfahdL4hor0LtSoBVzUsty8yCNeYJvVFO7Xy+t8gs6c0pU/asUNbKnX QHA8xCfpZgQuAXFhEiDtH7VSQ4xHHEU/+Oun4j1zhonM7wGnTOQLDFCd7w2zKFNcEYP8 lgqKIay+RQneVnp0Y82QWAZHrYJkXPgoaOdNvcKKgrNEtvJp6MtYmW7pzfZNl6gSQRwA N/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=ufXO40vN; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b="CKm3/sKW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si4090647oou.60.2020.03.28.08.26.12; Sat, 28 Mar 2020 08:26:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=ufXO40vN; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b="CKm3/sKW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgC1PZu (ORCPT + 99 others); Sat, 28 Mar 2020 11:25:50 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:56560 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgC1PZt (ORCPT ); Sat, 28 Mar 2020 11:25:49 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 4D9038EE182; Sat, 28 Mar 2020 08:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1585409149; bh=7ol25urUbt6cSQxZY2to1Yas4j/y3AL+k7+hznk8G0k=; h=Subject:From:To:Cc:Date:From; b=ufXO40vNUXvjmP6zq45Oq+xBMt3IYmqyBzxidj4D0WZiREa6hqATUYVX8hA8EVlPx +89ZXfN/hTgMdFi3LqI/lxADZApgroLv4qNkq9M6O7Eq1j+caAE42vP57DCB8ezHUA P0VsqMNPCoWLNiFFwHaTVFf0ByDD7aGL8l8ajiH8= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AHvwi3JfKNAC; Sat, 28 Mar 2020 08:25:48 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.76.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id D14B18EE111; Sat, 28 Mar 2020 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1585409147; bh=7ol25urUbt6cSQxZY2to1Yas4j/y3AL+k7+hznk8G0k=; h=Subject:From:To:Cc:Date:From; b=CKm3/sKW+PbI19924tZmS+he76JP0rtTTjXUOJx2nHH9UitI6XztPmbyscq5bXHcy +vRDhpyT08zTiBQtxm9d7oIZ72pJDgLLtLv2HUiUnmfSmoxaYUtZ9+h6ubQiDzeRhP TDEasqZvQzJb4rhP33mnPUA6xksuEXU0CNHGrDJo= Message-ID: <1585409145.15200.3.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.6-rc7 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Sat, 28 Mar 2020 08:25:45 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two small fixes, one in drivers (qla2xxx) and one in the core (sd) to try to cope with USB enclosures that silently change reported parameters. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Arun Easi (1): scsi: qla2xxx: Fix I/Os being passed down when FC device is being deleted Martin K. Petersen (1): scsi: sd: Fix optimal I/O size for devices that change reported values And the diffstat: drivers/scsi/qla2xxx/qla_os.c | 4 ++-- drivers/scsi/sd.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b520a980d1dc..7a94e1171c72 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -864,7 +864,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) goto qc24_fail_command; } - if (atomic_read(&fcport->state) != FCS_ONLINE) { + if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) { if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || atomic_read(&base_vha->loop_state) == LOOP_DEAD) { ql_dbg(ql_dbg_io, vha, 0x3005, @@ -946,7 +946,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, goto qc24_fail_command; } - if (atomic_read(&fcport->state) != FCS_ONLINE) { + if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) { if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || atomic_read(&base_vha->loop_state) == LOOP_DEAD) { ql_dbg(ql_dbg_io, vha, 0x3077, diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8ca9299ffd36..2710a0e5ae6d 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3169,9 +3169,11 @@ static int sd_revalidate_disk(struct gendisk *disk) if (sd_validate_opt_xfer_size(sdkp, dev_max)) { q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); - } else + } else { + q->limits.io_opt = 0; rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), (sector_t)BLK_DEF_MAX_SECTORS); + } /* Do not exceed controller limit */ rw_max = min(rw_max, queue_max_hw_sectors(q));