[tytso-ext4:dev 6/13] fs/ext4/super.c:2689:51: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head:   ba2e524d918ab72c0e5edc02354bd6cb43d005f8
commit: e6e268cb682290da29e3c8408493a4474307b8cc [6/13] ext4: move quota configuration out of handle_mount_opt()
config: m68k-randconfig-s032-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101722.3Kpomg0h-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=e6e268cb682290da29e3c8408493a4474307b8cc
        git remote add tytso-ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
        git fetch --no-tags tytso-ext4 dev
        git checkout e6e268cb682290da29e3c8408493a4474307b8cc
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash fs/ext4/

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


sparse warnings: (new ones prefixed by >>)
>> fs/ext4/super.c:2689:51: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char [noderef] __rcu * @@
   fs/ext4/super.c:2689:51: sparse:     expected char const *
   fs/ext4/super.c:2689:51: sparse:     got char [noderef] __rcu *
>> fs/ext4/super.c:2657:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got char [noderef] __rcu * @@
   fs/ext4/super.c:2657:38: sparse:     expected void const *objp
   fs/ext4/super.c:2657:38: sparse:     got char [noderef] __rcu *

vim +2689 fs/ext4/super.c

  2642	
  2643	static void ext4_apply_quota_options(struct fs_context *fc,
  2644					     struct super_block *sb)
  2645	{
  2646	#ifdef CONFIG_QUOTA
  2647		struct ext4_fs_context *ctx = fc->fs_private;
  2648		struct ext4_sb_info *sbi = EXT4_SB(sb);
  2649		char *qname;
  2650		int i;
  2651	
  2652		for (i = 0; i < EXT4_MAXQUOTAS; i++) {
  2653			if (!(ctx->qname_spec & (1 << i)))
  2654				continue;
  2655			qname = ctx->s_qf_names[i]; /* May be NULL */
  2656			ctx->s_qf_names[i] = NULL;
> 2657			kfree(sbi->s_qf_names[i]);
  2658			rcu_assign_pointer(sbi->s_qf_names[i], qname);
  2659			set_opt(sb, QUOTA);
  2660		}
  2661	#endif
  2662	}
  2663	
  2664	/*
  2665	 * Check quota settings consistency.
  2666	 */
  2667	static int ext4_check_quota_consistency(struct fs_context *fc,
  2668						struct super_block *sb)
  2669	{
  2670	#ifdef CONFIG_QUOTA
  2671		struct ext4_fs_context *ctx = fc->fs_private;
  2672		struct ext4_sb_info *sbi = EXT4_SB(sb);
  2673		bool quota_feature = ext4_has_feature_quota(sb);
  2674		bool quota_loaded = sb_any_quota_loaded(sb);
  2675		int i;
  2676	
  2677		if (ctx->qname_spec && quota_loaded) {
  2678			if (quota_feature)
  2679				goto err_feature;
  2680	
  2681			for (i = 0; i < EXT4_MAXQUOTAS; i++) {
  2682				if (!(ctx->qname_spec & (1 << i)))
  2683					continue;
  2684	
  2685				if (!!sbi->s_qf_names[i] != !!ctx->s_qf_names[i])
  2686					goto err_jquota_change;
  2687	
  2688				if (sbi->s_qf_names[i] && ctx->s_qf_names[i] &&
> 2689				    strcmp(sbi->s_qf_names[i],
  2690					   ctx->s_qf_names[i]) != 0)
  2691					goto err_jquota_specified;
  2692			}
  2693		}
  2694	
  2695		if (ctx->s_jquota_fmt) {
  2696			if (sbi->s_jquota_fmt != ctx->s_jquota_fmt && quota_loaded)
  2697				goto err_quota_change;
  2698			if (quota_feature) {
  2699				ext4_msg(NULL, KERN_INFO, "Quota format mount options "
  2700					 "ignored when QUOTA feature is enabled");
  2701				return 0;
  2702			}
  2703		}
  2704		return 0;
  2705	
  2706	err_quota_change:
  2707		ext4_msg(NULL, KERN_ERR,
  2708			 "Cannot change quota options when quota turned on");
  2709		return -EINVAL;
  2710	err_jquota_change:
  2711		ext4_msg(NULL, KERN_ERR, "Cannot change journaled quota "
  2712			 "options when quota turned on");
  2713		return -EINVAL;
  2714	err_jquota_specified:
  2715		ext4_msg(NULL, KERN_ERR, "%s quota file already specified",
  2716			 QTYPE2NAME(i));
  2717		return -EINVAL;
  2718	err_feature:
  2719		ext4_msg(NULL, KERN_ERR, "Journaled quota options ignored "
  2720			 "when QUOTA feature is enabled");
  2721		return 0;
  2722	#else
  2723		return 0;
  2724	#endif
  2725	}
  2726	

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



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux