All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Ewan D. Milne" <emilne@redhat.com>,
	Christoph Hellwig <hch@lst.de>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 06/26] scsi: sd: Suppress spurious errors when WRITE SAME is being disabled
Date: Tue, 19 Jan 2021 20:26:43 -0500	[thread overview]
Message-ID: <20210120012704.770095-6-sashal@kernel.org> (raw)
In-Reply-To: <20210120012704.770095-1-sashal@kernel.org>

From: "Ewan D. Milne" <emilne@redhat.com>

[ Upstream commit e5cc9002caafacbaa8dab878d17a313192c3b03b ]

The block layer code will split a large zeroout request into multiple bios
and if WRITE SAME is disabled because the storage device reports that it
does not support it (or support the length used), we can get an error
message from the block layer despite the setting of RQF_QUIET on the first
request.  This is because more than one request may have already been
submitted.

Fix this by setting RQF_QUIET when BLK_STS_TARGET is returned to fail the
request early, we don't need to log a message because we did not actually
submit the command to the device, and the block layer code will handle the
error by submitting individual write bios.

Link: https://lore.kernel.org/r/20201207221021.28243-1-emilne@redhat.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/sd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6a2f8bacfacea..f55249766d224 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -934,8 +934,10 @@ static blk_status_t sd_setup_write_zeroes_cmnd(struct scsi_cmnd *cmd)
 		}
 	}
 
-	if (sdp->no_write_same)
+	if (sdp->no_write_same) {
+		rq->rq_flags |= RQF_QUIET;
 		return BLK_STS_TARGET;
+	}
 
 	if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff)
 		return sd_setup_write_same16_cmnd(cmd, false);
-- 
2.27.0


  parent reply	other threads:[~2021-01-20  2:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  1:26 [PATCH AUTOSEL 5.4 01/26] ASoC: Intel: haswell: Add missing pm_ops Sasha Levin
2021-01-20  1:26 ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 02/26] HID: multitouch: Enable multi-input for Synaptics pointstick/touchpad device Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 03/26] dm integrity: select CRYPTO_SKCIPHER Sasha Levin
2021-01-20  1:26   ` [dm-devel] " Sasha Levin
2021-01-20  5:47   ` Eric Biggers
2021-01-20  5:47     ` Eric Biggers
2021-02-05  0:28     ` Sasha Levin
2021-02-05  0:28       ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 04/26] scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 05/26] scsi: qedi: Correct max length of CHAP secret Sasha Levin
2021-01-20  1:26 ` Sasha Levin [this message]
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 07/26] riscv: Fix kernel time_init() Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 08/26] riscv: Fix sifive serial driver Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 09/26] HID: logitech-dj: add the G602 receiver Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 10/26] HID: Ignore battery for Elan touchscreen on ASUS UX550 Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 11/26] clk: tegra30: Add hda clock default rates to clock driver Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 12/26] r8152: Add Lenovo Powered USB-C Travel Hub Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 13/26] arm64: make atomic helpers __always_inline Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 14/26] xen: Fix event channel callback via INTX/GSI Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 15/26] x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 16/26] net: stmmac: Fixed mtu channged by cache aligned Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 17/26] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 18/26] dts: phy: add GPIO number and active state used for phy reset Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 19/26] riscv: defconfig: enable gpio support for HiFive Unleashed Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 20/26] drm/amdgpu/psp: fix psp gfx ctrl cmds Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 21/26] drm/amd/display: Fix to be able to stop crc calculation Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26 ` [PATCH AUTOSEL 5.4 22/26] drm/nouveau/bios: fix issue shadowing expansion ROMs Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:26   ` Sasha Levin
2021-01-20  1:27 ` [PATCH AUTOSEL 5.4 23/26] drm/nouveau/privring: ack interrupts the same way as RM Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27 ` [PATCH AUTOSEL 5.4 24/26] drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27 ` [PATCH AUTOSEL 5.4 25/26] drm/nouveau/mmu: fix vram heap sizing Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27 ` [PATCH AUTOSEL 5.4 26/26] drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0 Sasha Levin
2021-01-20  1:27   ` Sasha Levin
2021-01-20  1:27   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210120012704.770095-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=emilne@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.