public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
@ 2025-12-20 17:38 Vitaliy Filippov
  2025-12-21  7:10 ` kernel test robot
  2025-12-21 13:01 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Vitaliy Filippov @ 2025-12-20 17:38 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 | 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


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

* Re: [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
  2025-12-20 17:38 [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary Vitaliy Filippov
@ 2025-12-21  7:10 ` kernel test robot
  2025-12-21 13:01 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-12-21  7:10 UTC (permalink / raw)
  To: Vitaliy Filippov, linux-block, linux-nvme; +Cc: oe-kbuild-all, Vitaliy Filippov

Hi Vitaliy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brauner-vfs/vfs.all]
[also build test WARNING on linus/master v6.19-rc1 next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Vitaliy-Filippov/Do-not-require-atomic-writes-to-be-power-of-2-sized-and-aligned-on-length-boundary/20251221-014115
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20251220173833.71176-1-vitalifster%40gmail.com
patch subject: [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
config: arc-allnoconfig (https://download.01.org/0day-ci/archive/20251221/202512211405.FsWuMZAC-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512211405.FsWuMZAC-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512211405.FsWuMZAC-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/read_write.c: In function 'generic_atomic_write_valid':
>> fs/read_write.c:1805:16: warning: unused variable 'len' [-Wunused-variable]
    1805 |         size_t len = iov_iter_count(iter);
         |                ^~~


vim +/len +1805 fs/read_write.c

c34fc6f26ab86d0 Prasad Singamsetty 2024-06-20  1802  
c3be7ebbbce5201 John Garry         2024-10-19  1803  int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter)
c34fc6f26ab86d0 Prasad Singamsetty 2024-06-20  1804  {
c34fc6f26ab86d0 Prasad Singamsetty 2024-06-20 @1805  	size_t len = iov_iter_count(iter);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
@ 2025-12-21 11:17 Vitaliy Filippov
  0 siblings, 0 replies; 4+ messages in thread
From: Vitaliy Filippov @ 2025-12-21 11:17 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] 4+ messages in thread

* Re: [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
  2025-12-20 17:38 [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary Vitaliy Filippov
  2025-12-21  7:10 ` kernel test robot
@ 2025-12-21 13:01 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-12-21 13:01 UTC (permalink / raw)
  To: Vitaliy Filippov, linux-block, linux-nvme
  Cc: llvm, oe-kbuild-all, Vitaliy Filippov

Hi Vitaliy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brauner-vfs/vfs.all]
[also build test WARNING on linus/master v6.19-rc1 next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Vitaliy-Filippov/Do-not-require-atomic-writes-to-be-power-of-2-sized-and-aligned-on-length-boundary/20251221-014115
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20251220173833.71176-1-vitalifster%40gmail.com
patch subject: [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251221/202512211420.W7jr2osh-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512211420.W7jr2osh-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512211420.W7jr2osh-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/read_write.c:1805:9: warning: unused variable 'len' [-Wunused-variable]
    1805 |         size_t len = iov_iter_count(iter);
         |                ^~~
   1 warning generated.


vim +/len +1805 fs/read_write.c

c34fc6f26ab86d Prasad Singamsetty 2024-06-20  1802  
c3be7ebbbce520 John Garry         2024-10-19  1803  int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter)
c34fc6f26ab86d Prasad Singamsetty 2024-06-20  1804  {
c34fc6f26ab86d Prasad Singamsetty 2024-06-20 @1805  	size_t len = iov_iter_count(iter);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-12-21 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20 17:38 [PATCH] Do not require atomic writes to be power of 2 sized and aligned on length boundary Vitaliy Filippov
2025-12-21  7:10 ` 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

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