From: Christoph Hellwig <hch@lst.de>
To: Chris Down <chris@chrisdown.name>
Cc: "Martin K. Petersen" <mkp@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
Christoph Hellwig <hch@lst.de>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH 1/2] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes
Date: Wed, 11 Nov 2026 17:46:32 +0100 [thread overview]
Message-ID: <20261111164632.GB18355@lst.de> (raw)
In-Reply-To: <5cb23933fe87df3c342d9805a7fe8c2a1e08ff37.1794069087.git.chris@chrisdown.name>
On Sat, Nov 07, 2026 at 08:35:14AM -0800, Chris Down wrote:
> In writesame_10_unmap mode, we send write zeroes as WRITE SAME(10).
> If the LBA or count doesn't fit, we truncate it and can return
> success without zeroing the requested range. If the LBA wraps, we
> can also corrupt live data near the start of the disk.
>
> Cap the queue limit when sd selects this mode so large requests can
> still unmap in chunks. If the LBA or count still won't fit, fall back
> to WRITE SAME(16) with UNMAP clear. All the caller needs is for the
> requested blocks to read back as zeroes.
Shoudn't we simply refuse to use writesame_10_unmap for devices
where 10-byte commands can't fit the entire capacity instead?
next prev parent reply other threads:[~2026-11-11 16:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 16:35 [PATCH 0/2] scsi: sd: Fix WRITE SAME(10) data corruption Chris Down
2026-11-07 16:35 ` [PATCH 1/2] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes Chris Down
2026-11-11 16:46 ` Christoph Hellwig [this message]
2026-11-07 16:35 ` [PATCH 2/2] scsi: sd: Fix data corruption in WRITE SAME(10) discards Chris Down
2026-11-11 16:47 ` Christoph Hellwig
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=20261111164632.GB18355@lst.de \
--to=hch@lst.de \
--cc=James.Bottomley@hansenpartnership.com \
--cc=chris@chrisdown.name \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®