[PATCH 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size

alexjlzheng@gmail.com posted 4 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size
Posted by alexjlzheng@gmail.com 1 month, 3 weeks ago
From: Jinliang Zheng <alexjlzheng@tencent.com>

iomap_folio_state marks the uptodate state in units of block_size, so
it is better to check that pos and length are aligned with block_size.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
---
 fs/iomap/buffered-io.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index fd827398afd2..27fa93ca8675 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -234,6 +234,9 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,
 	unsigned first = poff >> block_bits;
 	unsigned last = (poff + plen - 1) >> block_bits;
 
+	BUG_ON(*pos % block_size);
+	BUG_ON(length % block_size);
+
 	/*
 	 * If the block size is smaller than the page size, we need to check the
 	 * per-block uptodate status and adjust the offset and length if needed
-- 
2.49.0
Re: [PATCH 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size
Posted by kernel test robot 1 month, 3 weeks ago
Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on brauner-vfs/vfs.all]
[also build test ERROR on linus/master v6.16 next-20250808]
[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/alexjlzheng-gmail-com/iomap-make-sure-iomap_adjust_read_range-are-aligned-with-block_size/20250810-125014
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20250810044806.3433783-2-alexjlzheng%40tencent.com
patch subject: [PATCH 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250810/202508101424.M8eWrUjI-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250810/202508101424.M8eWrUjI-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/202508101424.M8eWrUjI-lkp@intel.com/

All errors (new ones prefixed by >>):

   m68k-linux-ld: fs/iomap/buffered-io.o: in function `iomap_adjust_read_range':
>> buffered-io.c:(.text+0xa8a): undefined reference to `__moddi3'
>> m68k-linux-ld: buffered-io.c:(.text+0xaa8): undefined reference to `__moddi3'

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