public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaliy Filippov <vitalifster@gmail.com>
To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Cc: Vitaliy Filippov <vitalifster@gmail.com>
Subject: [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
Date: Sat, 20 Dec 2025 20:38:33 +0300	[thread overview]
Message-ID: <20251220173833.71176-1-vitalifster@gmail.com> (raw)

It contradicts NVMe specification where alignment is only required when atomic
write boundary (NABSPF/NABO) is set and highly limits usage of NVMe atomic writes

Signed-off-by: Vitaliy Filippov <vitalifster@gmail.com>
---
 fs/read_write.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 833bae068770..8b901be75a9f 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1807,12 +1807,6 @@ int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter)
 	if (!iter_is_ubuf(iter))
 		return -EINVAL;
 
-	if (!is_power_of_2(len))
-		return -EINVAL;
-
-	if (!IS_ALIGNED(iocb->ki_pos, len))
-		return -EINVAL;
-
 	if (!(iocb->ki_flags & IOCB_DIRECT))
 		return -EOPNOTSUPP;
 
-- 
2.51.0


             reply	other threads:[~2025-12-20 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20 17:38 Vitaliy Filippov [this message]
2025-12-21  7:10 ` [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary kernel test robot
2025-12-21 13:01 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-12-21 11:17 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=20251220173833.71176-1-vitalifster@gmail.com \
    --to=vitalifster@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.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