fs/bcachefs/util.h:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Wed Nov 08 2023 - 01:11:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 305230142ae0637213bf6e04f6d9f10bbcb74af8
commit: 3598c56eb93b9774d3aa06b3e3c0eab0bbbc26f0 bcachefs: Consolidate trigger code a bit
date: 2 weeks ago
config: loongarch-randconfig-r132-20231107 (https://download.01.org/0day-ci/archive/20231108/202311081415.GURBBbjx-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231108/202311081415.GURBBbjx-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311081415.GURBBbjx-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
fs/bcachefs/buckets.c: note: in included file:
fs/bcachefs/bcachefs.h:845:9: sparse: sparse: array of flexible structures
fs/bcachefs/buckets.c: note: in included file:
fs/bcachefs/replicas.h:42:34: sparse: sparse: array of flexible structures
fs/bcachefs/buckets.c:1125:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:1125:26: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:1125:26: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:1154:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:1154:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:1154:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got unsigned int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got unsigned int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got unsigned int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got unsigned int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got int [noderef] __percpu *
include/linux/seqlock.h:269:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
include/linux/seqlock.h:269:9: sparse: expected void *ptr
include/linux/seqlock.h:269:9: sparse: got int [noderef] __percpu *
fs/bcachefs/buckets.c:403:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:403:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:403:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:404:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bch_fs_usage *fs_usage @@ got struct bch_fs_usage [noderef] __percpu *fs_usage @@
fs/bcachefs/buckets.c:404:36: sparse: expected struct bch_fs_usage *fs_usage
fs/bcachefs/buckets.c:404:36: sparse: got struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:405:27: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:403:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:403:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:403:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:404:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bch_fs_usage *fs_usage @@ got struct bch_fs_usage [noderef] __percpu *fs_usage @@
fs/bcachefs/buckets.c:404:36: sparse: expected struct bch_fs_usage *fs_usage
fs/bcachefs/buckets.c:404:36: sparse: got struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:405:27: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c: note: in included file (through fs/bcachefs/super.h, fs/bcachefs/buckets.h, fs/bcachefs/alloc_background.h):
fs/bcachefs/extents.h:145:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] @@ got unsigned int const [usertype] csum @@
fs/bcachefs/extents.h:145:44: sparse: expected restricted __le32 [usertype]
fs/bcachefs/extents.h:145:44: sparse: got unsigned int const [usertype] csum
fs/bcachefs/extents.h:159:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] @@ got unsigned long long const [usertype] csum_hi:16 @@
fs/bcachefs/extents.h:159:44: sparse: expected restricted __le16 [usertype]
fs/bcachefs/extents.h:159:44: sparse: got unsigned long long const [usertype] csum_hi:16
fs/bcachefs/extents.h:145:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] @@ got unsigned int const [usertype] csum @@
fs/bcachefs/extents.h:145:44: sparse: expected restricted __le32 [usertype]
fs/bcachefs/extents.h:145:44: sparse: got unsigned int const [usertype] csum
fs/bcachefs/extents.h:159:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] @@ got unsigned long long const [usertype] csum_hi:16 @@
fs/bcachefs/extents.h:159:44: sparse: expected restricted __le16 [usertype]
fs/bcachefs/extents.h:159:44: sparse: got unsigned long long const [usertype] csum_hi:16
fs/bcachefs/buckets.c:403:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:403:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:403:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:404:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bch_fs_usage *fs_usage @@ got struct bch_fs_usage [noderef] __percpu *fs_usage @@
fs/bcachefs/buckets.c:404:36: sparse: expected struct bch_fs_usage *fs_usage
fs/bcachefs/buckets.c:404:36: sparse: got struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:405:27: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:403:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:403:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:403:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:404:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bch_fs_usage *fs_usage @@ got struct bch_fs_usage [noderef] __percpu *fs_usage @@
fs/bcachefs/buckets.c:404:36: sparse: expected struct bch_fs_usage *fs_usage
fs/bcachefs/buckets.c:404:36: sparse: got struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:405:27: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:403:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bch_fs_usage [noderef] __percpu *fs_usage @@ got struct bch_fs_usage * @@
fs/bcachefs/buckets.c:403:18: sparse: expected struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:403:18: sparse: got struct bch_fs_usage *
fs/bcachefs/buckets.c:404:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bch_fs_usage *fs_usage @@ got struct bch_fs_usage [noderef] __percpu *fs_usage @@
fs/bcachefs/buckets.c:404:36: sparse: expected struct bch_fs_usage *fs_usage
fs/bcachefs/buckets.c:404:36: sparse: got struct bch_fs_usage [noderef] __percpu *fs_usage
fs/bcachefs/buckets.c:405:27: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:1126:17: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:1127:17: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:1158:9: sparse: sparse: dereference of noderef expression
fs/bcachefs/buckets.c:1159:38: sparse: sparse: dereference of noderef expression
fs/bcachefs/extents.h:145:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] @@ got unsigned int const [usertype] csum @@
fs/bcachefs/extents.h:145:44: sparse: expected restricted __le32 [usertype]
fs/bcachefs/extents.h:145:44: sparse: got unsigned int const [usertype] csum
fs/bcachefs/extents.h:159:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] @@ got unsigned long long const [usertype] csum_hi:16 @@
fs/bcachefs/extents.h:159:44: sparse: expected restricted __le16 [usertype]
fs/bcachefs/extents.h:159:44: sparse: got unsigned long long const [usertype] csum_hi:16
fs/bcachefs/extents.h:145:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] @@ got unsigned int const [usertype] csum @@
fs/bcachefs/extents.h:145:44: sparse: expected restricted __le32 [usertype]
fs/bcachefs/extents.h:145:44: sparse: got unsigned int const [usertype] csum
fs/bcachefs/extents.h:159:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] @@ got unsigned long long const [usertype] csum_hi:16 @@
fs/bcachefs/extents.h:159:44: sparse: expected restricted __le16 [usertype]
fs/bcachefs/extents.h:159:44: sparse: got unsigned long long const [usertype] csum_hi:16
fs/bcachefs/buckets.c: note: in included file (through fs/bcachefs/vstructs.h, fs/bcachefs/bcachefs_format.h, fs/bcachefs/bcachefs.h):
>> fs/bcachefs/util.h:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned long long [noderef] [usertype] __percpu *dst @@
fs/bcachefs/util.h:867:9: sparse: expected void *ptr
fs/bcachefs/util.h:867:9: sparse: got unsigned long long [noderef] [usertype] __percpu *dst
>> fs/bcachefs/util.h:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned long long [noderef] [usertype] __percpu *dst @@
fs/bcachefs/util.h:867:9: sparse: expected void *ptr
fs/bcachefs/util.h:867:9: sparse: got unsigned long long [noderef] [usertype] __percpu *dst
>> fs/bcachefs/util.h:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned long long [noderef] [usertype] __percpu *dst @@
fs/bcachefs/util.h:867:9: sparse: expected void *ptr
fs/bcachefs/util.h:867:9: sparse: got unsigned long long [noderef] [usertype] __percpu *dst
>> fs/bcachefs/util.h:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned long long [noderef] [usertype] __percpu *dst @@
fs/bcachefs/util.h:867:9: sparse: expected void *ptr
fs/bcachefs/util.h:867:9: sparse: got unsigned long long [noderef] [usertype] __percpu *dst

vim +867 fs/bcachefs/util.h

4c97e04aa8818d Kent Overstreet 2019-02-06 860
4c97e04aa8818d Kent Overstreet 2019-02-06 861 static inline void percpu_u64_set(u64 __percpu *dst, u64 src)
4c97e04aa8818d Kent Overstreet 2019-02-06 862 {
4c97e04aa8818d Kent Overstreet 2019-02-06 863 int cpu;
4c97e04aa8818d Kent Overstreet 2019-02-06 864
4c97e04aa8818d Kent Overstreet 2019-02-06 865 for_each_possible_cpu(cpu)
4c97e04aa8818d Kent Overstreet 2019-02-06 866 *per_cpu_ptr(dst, cpu) = 0;
109a4277124ca1 Kent Overstreet 2021-06-10 @867 this_cpu_write(*dst, src);
4c97e04aa8818d Kent Overstreet 2019-02-06 868 }
4c97e04aa8818d Kent Overstreet 2019-02-06 869

:::::: The code at line 867 was first introduced by commit
:::::: 109a4277124ca1a0ff670b519315c4f381c83ad3 bcachefs: Don't disable preemption unnecessarily

:::::: TO: Kent Overstreet <kent.overstreet@xxxxxxxxx>
:::::: CC: Kent Overstreet <kent.overstreet@xxxxxxxxx>

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