public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Do not require atomic writes to be power of 2 sized and aligned on length boundary
@ 2025-12-21 13:24 Vitaliy Filippov
  2025-12-21 23:17 ` Keith Busch
  2026-01-28  6:08 ` Ojaswin Mujoo
  0 siblings, 2 replies; 8+ messages in thread
From: Vitaliy Filippov @ 2025-12-21 13:24 UTC (permalink / raw)
  To: linux-block, linux-nvme; +Cc: Vitaliy Filippov

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 | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 833bae068770..5467d710108d 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1802,17 +1802,9 @@ int generic_file_rw_checks(struct file *file_in, struct file *file_out)
 
 int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter)
 {
-	size_t len = iov_iter_count(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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-28  6:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-21 13:24 [PATCH v2] Do not require atomic writes to be power of 2 sized and aligned on length boundary Vitaliy Filippov
2025-12-21 23:17 ` Keith Busch
2025-12-22  9:54   ` Vitaliy Filippov
2025-12-22 13:28     ` Vitaliy Filippov
2025-12-23  9:26       ` John Garry
2025-12-23 11:19         ` Vitaliy Filippov
2025-12-23 11:34           ` Vitaliy Filippov
2026-01-28  6:08 ` Ojaswin Mujoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox