[xiang-erofs:dev-test 9/12] fs/erofs/inode.c:19:56: error: 'off' undeclared

kernel test robot lkp at intel.com
Mon Sep 9 18:07:41 AEST 2024


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test
head:   c45b42bcbc9c3fb421b8a4f7b3112b401971530b
commit: afcb9dd4a55ab82970251b75c2a5461025ed4d8a [9/12] erofs: refactor read_inode calling convention
config: i386-buildonly-randconfig-003-20240909 (https://download.01.org/0day-ci/archive/20240909/202409091602.2XlSy6FO-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240909/202409091602.2XlSy6FO-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409091602.2XlSy6FO-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/string.h:12,
                    from arch/x86/include/asm/page_32.h:18,
                    from arch/x86/include/asm/page.h:14,
                    from arch/x86/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:60,
                    from include/linux/spinlock.h:60,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from fs/erofs/internal.h:10,
                    from fs/erofs/xattr.h:9,
                    from fs/erofs/inode.c:7:
   fs/erofs/inode.c: In function 'erofs_fill_symlink':
>> fs/erofs/inode.c:19:56: error: 'off' undeclared (first use in this function)
      19 |             check_add_overflow(m_pofs, inode->i_size, &off) ||
         |                                                        ^~~
   include/linux/overflow.h:68:60: note: in definition of macro 'check_add_overflow'
      68 |         __must_check_overflow(__builtin_add_overflow(a, b, d))
         |                                                            ^
   fs/erofs/inode.c:19:56: note: each undeclared identifier is reported only once for each function it appears in
      19 |             check_add_overflow(m_pofs, inode->i_size, &off) ||
         |                                                        ^~~
   include/linux/overflow.h:68:60: note: in definition of macro 'check_add_overflow'
      68 |         __must_check_overflow(__builtin_add_overflow(a, b, d))
         |                                                            ^


vim +/off +19 fs/erofs/inode.c

    10	
    11	static int erofs_fill_symlink(struct inode *inode, void *kaddr,
    12				      unsigned int m_pofs)
    13	{
    14		struct erofs_inode *vi = EROFS_I(inode);
    15	
    16		m_pofs += vi->xattr_isize;
    17		/* check if it cannot be handled with fast symlink scheme */
    18		if (vi->datalayout != EROFS_INODE_FLAT_INLINE || inode->i_size < 0 ||
  > 19		    check_add_overflow(m_pofs, inode->i_size, &off) ||
    20		    off > i_blocksize(inode))
    21			return 0;
    22	
    23		inode->i_link = kmemdup_nul(kaddr + m_pofs, inode->i_size, GFP_KERNEL);
    24		return inode->i_link ? 0 : -ENOMEM;
    25	}
    26	

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


More information about the Linux-erofs mailing list