Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Bart Van Assche <bvanassche@acm.org>
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 v2 2/5] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes
Date: Sun, 29 Nov 2026 11:25:32 -0800	[thread overview]
Message-ID: <awx8LFEevHSXbM8m@chrisdown.name> (raw)
In-Reply-To: <79cccf57-7539-41c5-a4d0-dd71336f1111@acm.org>

Hi Bart,

Thanks for the detailed review! Much appreciated.

Bart Van Assche writes:
>(sector_t)U32_MAX + 1 is easier to read than `1 + (sector_t)0xffffffff`.

Sure, I'll use that in v3.

>If zeroing_mode_store() uses queue_limits_start_update() +
>blk_mq_freeze_queue() + queue_limits_commit_update() + unfreeze (like
>provisioning_mode_store()) and updates lim.max_hw_wzeroes_unmap_sectors,
>it closes these races and fixes the stale unmap limit after sysfs
>writes.

Yeah, that makes sense, I'll do that in v3. The limit update fits in
patch 1, and the check here moves under the limits lock.

max_write_same_blocks_store() needs the same for your second case,
since it sets max_ws_blocks before it takes the lock. With scsi_debug
I can get v2 to send WRITE SAME(10) with a count of zero that way, so
I'll change it together with the other stores in patch 4.

Chris

  reply	other threads:[~2026-11-29 19:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  9:26 [PATCH v2 0/5] scsi: sd: Fix WRITE SAME(10) data corruption Chris Down
2026-11-28  9:26 ` [PATCH v2 1/5] scsi: sd: Fix stale max_hw_wzeroes_unmap_sectors after a mode change Chris Down
2026-11-28  9:26 ` [PATCH v2 2/5] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes Chris Down
2026-11-29  2:38   ` Bart Van Assche
2026-11-29 19:25     ` Chris Down [this message]
2026-11-28  9:26 ` [PATCH v2 3/5] scsi: sd: Fix data corruption in WRITE SAME(10) discards Chris Down
2026-11-29  2:39   ` Bart Van Assche
2026-11-29 19:25     ` Chris Down
2026-11-28  9:26 ` [PATCH v2 4/5] scsi: sd: Fix WRITE SAME(10) count truncation when the mode changes Chris Down
2026-11-28  9:46   ` sashiko-bot
2026-11-29 19:25     ` Chris Down
2026-11-29  2:40   ` Bart Van Assche
2026-11-29 19:25     ` Chris Down
2026-11-28  9:26 ` [PATCH v2 5/5] scsi: sd: Fix unsplit discards when the granularity exceeds the limit Chris Down
2026-11-29  2:41   ` Bart Van Assche
2026-11-29 19:25     ` Chris Down

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=awx8LFEevHSXbM8m@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --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