Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Vitaliy Filippov <vitalifster@gmail.com>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: remove power of 2 and length boundary atomic write restrictions
Date: Fri, 2 Jan 2026 17:41:05 +0000	[thread overview]
Message-ID: <492a0427-2b84-47aa-b70c-a4355a7566f2@oracle.com> (raw)
In-Reply-To: <CAPqjcqqEAb9cUTU3QrmgZ7J-wc_b7Ai_8fi17q5OQAyRZ8RfwQ@mail.gmail.com>

On 30/12/2025 09:01, Vitaliy Filippov wrote:
> I think that even with the 2^N requirement the user still has to look
> for boundaries.
> 1) NVMe disks may have NABO != 0 (atomic boundary offset). In this
> case 2^N aligned writes won't work at all.

We don't support NABO != 0

> 2) NABSPF is expressed in blocks in the NVMe spec and it's not
> restricted to 2^N, it can be for example 3 (3*4096 = 12 KB). The spec
> allows it. 2^N breaks this case too.

We could support NABSPF which is not a power-of-2, but we don't today.

If you can find some real HW which has NABSPF which is not a power-of-2, 
then it can be considered.

> And the user also has to look for the maximum atomic write size
> anyway, he can't just assume all writes are atomic out of the box,
> regardless of the 2^N requirement.
> So my idea is that the kernel's task is just to guarantee correctness
> of atomic writes. It anyway can't provide the user with atomic writes
> in all cases.

What good is that to a user?

Consider the user wants to atomic write a range of a file which is 
backed by disk blocks which straddle a boundary - in this case, the 
write would fail. What is the user supposed to do then? That API could 
have arbitrary failures, which effectively makes it a useless API.

As I said before, just don't use RWF_ATOMIC if you don't want to deal 
with these restrictions.


  reply	other threads:[~2026-01-02 17:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-24 11:53 [PATCH] fs: remove power of 2 and length boundary atomic write restrictions Vitaliy Filippov
2025-12-29  7:15 ` kernel test robot
2025-12-30  7:54 ` John Garry
2025-12-30  9:01   ` Vitaliy Filippov
2026-01-02 17:41     ` John Garry [this message]
2026-01-05 18:58       ` Vitaliy Filippov
2026-01-06  9:06         ` John Garry
2026-01-06 10:50           ` Vitaliy Filippov
2026-01-06 11:26             ` John Garry
2026-01-06 13:08               ` Vitaliy Filippov
2026-01-07 10:51                 ` John Garry
2026-01-07 13:05                   ` Vitaliy Filippov
2026-01-07 15:42                     ` John Garry
2026-01-07 16:21                       ` Vitaliy Filippov
2026-01-08 18:18                       ` Vitaliy Filippov
2026-01-13 14:25                       ` Vitaliy Filippov
2026-01-05 19:29       ` Vitaliy Filippov
2026-01-05 19:44       ` Vitaliy Filippov
2026-01-06 10:55         ` Vitaliy Filippov

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=492a0427-2b84-47aa-b70c-a4355a7566f2@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=vitalifster@gmail.com \
    /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