All of lore.kernel.org
 help / color / mirror / Atom feed
* [sashal-linux-stable:queue-4.9 72/73] fs/f2fs/xattr.c:417:39: error: implicit declaration of function 'XATTR_SIZE'; did you mean
@ 2020-07-31 13:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-31 13:30 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4226 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.9
head:   336aa408ceb69e212b36b6b48465803834751ef9
commit: 188ab9c73451b848601a5caca0c842a22d0d1c90 [72/73] f2fs: fix to avoid memory leakage in f2fs_listxattr
config: c6x-randconfig-r021-20200731 (attached as .config)
compiler: c6x-elf-gcc (GCC) 7.5.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 188ab9c73451b848601a5caca0c842a22d0d1c90
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=c6x 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/f2fs/xattr.c: In function 'f2fs_listxattr':
>> fs/f2fs/xattr.c:417:39: error: implicit declaration of function 'XATTR_SIZE'; did you mean 'ATTR_SIZE'? [-Werror=implicit-function-declaration]
     last_base_addr = (void *)base_addr + XATTR_SIZE(xnid, inode);
                                          ^~~~~~~~~~
                                          ATTR_SIZE
>> fs/f2fs/xattr.c:428:4: error: implicit declaration of function 'f2fs_err'; did you mean 'f2fs_gc'? [-Werror=implicit-function-declaration]
       f2fs_err(F2FS_I_SB(inode), "inode (%lu) has corrupted xattr",
       ^~~~~~~~
       f2fs_gc
>> fs/f2fs/xattr.c:431:13: error: 'EFSCORRUPTED' undeclared (first use in this function); did you mean 'FS_NRSUPER'?
       error = -EFSCORRUPTED;
                ^~~~~~~~~~~~
                FS_NRSUPER
   fs/f2fs/xattr.c:431:13: note: each undeclared identifier is reported only once for each function it appears in
   In file included from fs/f2fs/xattr.c:25:0:
   fs/f2fs/f2fs.h: In function '__mark_inode_dirty_flag':
   fs/f2fs/f2fs.h:1636:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (set)
         ^
   fs/f2fs/f2fs.h:1638:2: note: here
     case FI_DATA_EXIST:
     ^~~~
   cc1: some warnings being treated as errors

vim +417 fs/f2fs/xattr.c

   403	
   404	ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
   405	{
   406		struct inode *inode = d_inode(dentry);
   407		nid_t xnid = F2FS_I(inode)->i_xattr_nid;
   408		struct f2fs_xattr_entry *entry;
   409		void *base_addr, *last_base_addr;
   410		int error = 0;
   411		size_t rest = buffer_size;
   412	
   413		error = read_all_xattrs(inode, NULL, &base_addr);
   414		if (error)
   415			return error;
   416	
 > 417		last_base_addr = (void *)base_addr + XATTR_SIZE(xnid, inode);
   418	
   419		list_for_each_xattr(entry, base_addr) {
   420			const struct xattr_handler *handler =
   421				f2fs_xattr_handler(entry->e_name_index);
   422			const char *prefix;
   423			size_t prefix_len;
   424			size_t size;
   425	
   426			if ((void *)(entry) + sizeof(__u32) > last_base_addr ||
   427				(void *)XATTR_NEXT_ENTRY(entry) > last_base_addr) {
 > 428				f2fs_err(F2FS_I_SB(inode), "inode (%lu) has corrupted xattr",
   429							inode->i_ino);
   430				set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK);
 > 431				error = -EFSCORRUPTED;
   432				goto cleanup;
   433			}
   434	
   435			if (!handler || (handler->list && !handler->list(dentry)))
   436				continue;
   437	
   438			prefix = handler->prefix ?: handler->name;
   439			prefix_len = strlen(prefix);
   440			size = prefix_len + entry->e_name_len + 1;
   441			if (buffer) {
   442				if (size > rest) {
   443					error = -ERANGE;
   444					goto cleanup;
   445				}
   446				memcpy(buffer, prefix, prefix_len);
   447				buffer += prefix_len;
   448				memcpy(buffer, entry->e_name, entry->e_name_len);
   449				buffer += entry->e_name_len;
   450				*buffer++ = 0;
   451			}
   452			rest -= size;
   453		}
   454		error = buffer_size - rest;
   455	cleanup:
   456		kzfree(base_addr);
   457		return error;
   458	}
   459	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17878 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-31 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31 13:30 [sashal-linux-stable:queue-4.9 72/73] fs/f2fs/xattr.c:417:39: error: implicit declaration of function 'XATTR_SIZE'; did you mean kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.