From: Chris Down <chris@chrisdown.name>
To: sashiko-reviews@lists.linux.dev
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
"Martin K. Petersen" <mkp@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>
Subject: Re: [PATCH v2 4/5] scsi: sd: Fix WRITE SAME(10) count truncation when the mode changes
Date: Sun, 29 Nov 2026 11:25:39 -0800 [thread overview]
Message-ID: <awx8M6bldUhmQ2wm@chrisdown.name> (raw)
In-Reply-To: <sashiko-outbox-238601@kernel.org>
sashiko-bot@kernel.org writes:
>Can calling set_capacity_and_notify() in the grown path after
>queue_limits_commit_update() unlocks q->limits_lock race with a
>concurrent sd_revalidate_disk() or update the capacity after a failed
>limits commit?
Yes, that race is there. The disk has to shrink back while the first
revalidate is still running, and the first one then has to be held up
between dropping the lock and setting the capacity for as long as the
second one takes. I only hit it with a sleep added there, but it does
leave a disk with more than 2^32 blocks in writesame_10 mode until the
next revalidate, and a discard to the new blocks is sent with its LBA
truncated again.
In v3 I'll set a grown capacity under the limits lock, so that it's
always the one the current modes were picked for.
>In addition, because err is checked after set_capacity_and_notify(), a
>failed queue_limits_commit_update() still publishes the new capacity while
>leaving the old queue limits in place and skipping
>sd_zbc_revalidate_zones().
That isn't new. sd_revalidate_disk() already called
set_capacity_and_notify() before the commit and only looked at err
afterwards, so I'll leave that as it is in this series.
Chris
next prev parent 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
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 [this message]
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=awx8M6bldUhmQ2wm@chrisdown.name \
--to=chris@chrisdown.name \
--cc=James.Bottomley@hansenpartnership.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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