linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 5325/7963] fs/file.c:401:54: sparse: sparse: incorrect type in initializer (different address spaces)
@ 2021-08-13 14:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-13 14:16 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: kbuild-all, Linux Memory Management List, linux-snps-arc

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4b358aabb93a2c654cd1dcab1a25a589f6e2b153
commit: 9cf1d7d830f4a586dfa4ddcaf9eae3959e0708ef [5325/7963] ARC: cmpxchg/xchg: rewrite as macros to make type safe
config: arc-randconfig-s031-20210813 (attached as .config)
compiler: arc-elf-gcc (GCC) 10.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=9cf1d7d830f4a586dfa4ddcaf9eae3959e0708ef
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 9cf1d7d830f4a586dfa4ddcaf9eae3959e0708ef
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc 

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


sparse warnings: (new ones prefixed by >>)
   fs/file.c:350:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **old_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:350:17: sparse:     expected struct file **old_fds
   fs/file.c:350:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:351:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **new_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:351:17: sparse:     expected struct file **new_fds
   fs/file.c:351:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:366:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/file.c:366:17: sparse:    struct file [noderef] __rcu *
   fs/file.c:366:17: sparse:    struct file *
>> fs/file.c:401:54: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu *[assigned] _val_ @@
   fs/file.c:441:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct fdtable [noderef] __rcu *fdt @@     got struct fdtable * @@
   fs/file.c:608:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:762:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:813:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:1038:16: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *tofree @@     got struct file [noderef] __rcu * @@

vim +401 fs/file.c

02afc6267f6d55 Al Viro          2008-05-08  382  
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  383  static struct fdtable *close_files(struct files_struct * files)
7cf4dc3c8dbfdf Al Viro          2012-08-15  384  {
7cf4dc3c8dbfdf Al Viro          2012-08-15  385  	/*
7cf4dc3c8dbfdf Al Viro          2012-08-15  386  	 * It is safe to dereference the fd table without RCU or
7cf4dc3c8dbfdf Al Viro          2012-08-15  387  	 * ->file_lock because this is the last reference to the
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  388  	 * files structure.
7cf4dc3c8dbfdf Al Viro          2012-08-15  389  	 */
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  390  	struct fdtable *fdt = rcu_dereference_raw(files->fdt);
9b80a184eaadc1 Alexey Dobriyan  2016-09-02  391  	unsigned int i, j = 0;
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  392  
7cf4dc3c8dbfdf Al Viro          2012-08-15  393  	for (;;) {
7cf4dc3c8dbfdf Al Viro          2012-08-15  394  		unsigned long set;
7cf4dc3c8dbfdf Al Viro          2012-08-15  395  		i = j * BITS_PER_LONG;
7cf4dc3c8dbfdf Al Viro          2012-08-15  396  		if (i >= fdt->max_fds)
7cf4dc3c8dbfdf Al Viro          2012-08-15  397  			break;
7cf4dc3c8dbfdf Al Viro          2012-08-15  398  		set = fdt->open_fds[j++];
7cf4dc3c8dbfdf Al Viro          2012-08-15  399  		while (set) {
7cf4dc3c8dbfdf Al Viro          2012-08-15  400  			if (set & 1) {
7cf4dc3c8dbfdf Al Viro          2012-08-15 @401  				struct file * file = xchg(&fdt->fd[i], NULL);
7cf4dc3c8dbfdf Al Viro          2012-08-15  402  				if (file) {
7cf4dc3c8dbfdf Al Viro          2012-08-15  403  					filp_close(file, files);
388a4c88064e7e Paul E. McKenney 2017-10-24  404  					cond_resched();
7cf4dc3c8dbfdf Al Viro          2012-08-15  405  				}
7cf4dc3c8dbfdf Al Viro          2012-08-15  406  			}
7cf4dc3c8dbfdf Al Viro          2012-08-15  407  			i++;
7cf4dc3c8dbfdf Al Viro          2012-08-15  408  			set >>= 1;
7cf4dc3c8dbfdf Al Viro          2012-08-15  409  		}
7cf4dc3c8dbfdf Al Viro          2012-08-15  410  	}
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  411  
ce08b62d18b3f9 Oleg Nesterov    2014-01-11  412  	return fdt;
7cf4dc3c8dbfdf Al Viro          2012-08-15  413  }
7cf4dc3c8dbfdf Al Viro          2012-08-15  414  

:::::: The code at line 401 was first introduced by commit
:::::: 7cf4dc3c8dbfdfde163d4636f621cf99a1f63bfb move files_struct-related bits from kernel/exit.c to fs/file.c

:::::: TO: Al Viro <viro@zeniv.linux.org.uk>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>

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

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

[-- Attachment #3: Type: text/plain, Size: 170 bytes --]

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

only message in thread, other threads:[~2021-08-13 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 14:16 [linux-next:master 5325/7963] fs/file.c:401:54: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).