mirror of https://lore.kernel.org/lkml/
 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, sashiko-bot@kernel.org,
	Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH v3 2/5] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes
Date: Mon, 30 Nov 2026 10:17:46 +0100	[thread overview]
Message-ID: <20261130091746.GB12202@lst.de> (raw)
In-Reply-To: <acdcf31694b29dd80fc9f10a2509121ece0b37de.1795967558.git.chris@chrisdown.name>

I find the subject a bit odd.  Something like:

sd: don't use WRITE SAME(10) on device requiring 64-bit addressing

a bit more useful.

The commit log could probably also use a bit trimming from the overly
verbose LLM style.

> +/* WRITE SAME(10) only has a 32-bit LBA field. */
> +static bool sd_can_use_ws10(struct scsi_disk *sdkp)
> +{
> +	sector_t max_blocks = (sector_t)U32_MAX + 1;
> +
> +	/*
> +	 * A removable disk without a medium has an sdkp->capacity of zero,
> +	 * but the gendisk keeps its old capacity until the next revalidate.
> +	 */
> +	return sdkp->capacity <= max_blocks &&
> +	       get_capacity(sdkp->disk) <=
> +	       logical_to_sectors(sdkp->device, max_blocks);
> +}

The comment seems oddly misplace, as it doesn't seem relevant
to any of the conditions.

The code change itself looks fine.

  reply	other threads:[~2026-11-30  9:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 19:25 [PATCH v3 0/5] scsi: sd: Fix WRITE SAME(10) data corruption Chris Down
2026-11-29 19:25 ` [PATCH v3 1/5] scsi: sd: Fix stale max_hw_wzeroes_unmap_sectors after a mode change Chris Down
2026-11-30  9:15   ` Christoph Hellwig
2026-11-29 19:25 ` [PATCH v3 2/5] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes Chris Down
2026-11-30  9:17   ` Christoph Hellwig [this message]
2026-11-29 19:25 ` [PATCH v3 3/5] scsi: sd: Fix data corruption in WRITE SAME(10) discards Chris Down
2026-11-30  9:18   ` Christoph Hellwig
2026-11-29 19:25 ` [PATCH v3 4/5] scsi: sd: Fix WRITE SAME(10) count truncation when the mode changes Chris Down
2026-11-29 19:25 ` [PATCH v3 5/5] scsi: sd: Fix truncation of WRITE SAME(10) requests that don't fit 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=20261130091746.GB12202@lst.de \
    --to=hch@lst.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bvanassche@acm.org \
    --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 \
    --cc=sashiko-bot@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®