Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Niklas Cassel <cassel@kernel.org>,
	John Garry <john.garry@linux.dev>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <mkp@kernel.org>,
	linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 2/2] scsi: scsi_debug: Validate zone access for WRITE ATOMIC (16)
Date: Fri, 18 Sep 2026 09:06:41 +0200	[thread overview]
Message-ID: <20260918070641.GA10655@lst.de> (raw)
In-Reply-To: <153761e3-b288-44bc-96d0-ddfb323f7428@kernel.org>

On Fri, Sep 18, 2026 at 01:15:36PM +0700, Damien Le Moal wrote:
> Sure, but it may not be that simple in practice because achieving atomic writes
> on HDD is not that simple: even though most modern HDDs do have some form of
> atomicity for single sector writes (e.g. on EPO events), even that is not
> guaranteed at all. So let's not assume anything that may end up being different
> than what a real implementation may do.

Besides that the whole concept of atomic writes on sequential write
required zones does not make much sense.

Atomic writes are about atomic updates of multiple sectors, but
sequential write required zoned never update existing data.  So the best
they could provide is to guarantee that either all or nothing of a single
command is appended at the write pointer.  It is very hard to find a way
to use this feature, as zoned writes all require metadata updates to
point to the current location, and without this the data won't be
reached.  There are some schemes to optimizes this by doing a zoned write
with a header containing the location as a sort of distributed log (zenfs
in userspace would be the canonical example), but even with that a torn
write would invalidate the recovery of this header.

In other words, there really is no point in supporting atomic writes on
ZBC.  So we should not implement it in scsi_debug, and disable the
feature in sd.  If we ever see real hardware and a real use case we can
reconsider, but I doubt it is going to happen.


  reply	other threads:[~2026-09-18  7:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  8:45 [PATCH 0/2] scsi: scsi_debug: fix zoned write validation Niklas Cassel
2026-09-17  8:45 ` [PATCH 1/2] scsi: scsi_debug: Enforce physical block alignment of zoned writes Niklas Cassel
2026-09-17  9:05   ` Damien Le Moal
2026-09-17 10:42     ` Niklas Cassel
2026-09-17  8:45 ` [PATCH 2/2] scsi: scsi_debug: Validate zone access for WRITE ATOMIC (16) Niklas Cassel
2026-09-17  9:00   ` sashiko-bot
2026-09-17  9:09     ` Niklas Cassel
2026-09-17  9:07   ` Damien Le Moal
2026-09-17  9:38   ` John Garry
2026-09-17  9:56     ` Niklas Cassel
2026-09-17 10:26       ` John Garry
2026-09-17 10:35         ` Niklas Cassel
2026-09-17 15:42           ` John Garry
2026-09-17 16:10             ` Niklas Cassel
2026-09-17 16:40               ` John Garry
2026-09-17 17:37               ` Niklas Cassel
2026-09-18  2:27                 ` Damien Le Moal
2026-09-18  5:37                   ` Niklas Cassel
2026-09-18  6:15                     ` Damien Le Moal
2026-09-18  7:06                       ` Christoph Hellwig [this message]
2026-09-18  7:27                         ` Niklas Cassel

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=20260918070641.GA10655@lst.de \
    --to=hch@lst.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=john.garry@linux.dev \
    --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