All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/2] scsi: sd: Fix data corruption in WRITE SAME(10) discards
Date: Wed, 11 Nov 2026 17:47:05 +0100	[thread overview]
Message-ID: <20261111164705.GC18355@lst.de> (raw)
In-Reply-To: <c58578f870580f92d1acd6cb73b59b7a7867d80b.1794069087.git.chris@chrisdown.name>

On Sat, Nov 07, 2026 at 08:35:29AM -0800, Chris Down wrote:
> We already cap the discard length in writesame_10 and writesame_zero
> mode, but we still truncate the starting LBA to 32 bits. A discard at
> or above block 2^32 can corrupt live data near the start of the disk
> and still report success.
> 
> Discard is advisory, so return BLK_STS_NOTSUPP if the request won't
> fit in WRITE SAME(10). Discards that fit can still go through.

Nah, that's not really how things work.  See my reply to patch 1
for the suggested proper fix.


      reply	other threads:[~2026-11-11 16:47 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
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 [this message]

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=20261111164705.GC18355@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 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.