]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
scsi: sd: Suppress spurious errors when WRITE SAME is being disabled
authorEwan D. Milne <emilne@redhat.com>
Mon, 7 Dec 2020 22:10:21 +0000 (17:10 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:45:35 +0000 (16:45 +0100)
commit1776ef2c06a1dea63f6cb09778657ff34f4e8ab0
treecbb01675fa4657c5c991e100112ef99e346ed718
parent82ae9c49aff600df692ff5d55259844fc8bef553
scsi: sd: Suppress spurious errors when WRITE SAME is being disabled

BugLink: https://bugs.launchpad.net/bugs/1915195
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
drivers/scsi/sd.c