Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Moal <dlemoal@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
Subject: Re: [PATCH 2/2] scsi: scsi_debug: Validate zone access for WRITE ATOMIC (16)
Date: Fri, 18 Sep 2026 09:27:59 +0200	[thread overview]
Message-ID: <aqzn_y5A0w3KQiFh@ryzen> (raw)
In-Reply-To: <20260918070641.GA10655@lst.de>

Hello Christoph,

On Fri, Sep 18, 2026 at 09:06:41AM +0200, Christoph Hellwig wrote:
> 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.

I have just sent out a new version of this series, and in this patch:
https://lore.kernel.org/linux-scsi/20260918062910.1709791-14-cassel@kernel.org/

a combination of ZBC and atomic writes is rejected by scsi_debug.


This series does not touch sd.c, so changes to sd.c should be a separate patch.
From you reply, it is obvious that you would be able to write a sd.c patch with
a better motivation than anything that I would attempt to cook up.


Kind regards,
Niklas

      reply	other threads:[~2026-09-18  7:28 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
2026-09-18  7:27                         ` Niklas Cassel [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=aqzn_y5A0w3KQiFh@ryzen \
    --to=cassel@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --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