tree: https://github.com/ammarfaizi2/linux-block brauner/linux/fs.xattr.simple.rework.rbtree head: 22b0856d76843b1ec4c7f0c379059f2d6114cfaf commit: 22b0856d76843b1ec4c7f0c379059f2d6114cfaf [1/1] xattr: use rbtree for simple_xattrs config: mips-randconfig-s053-20221107 compiler: mipsel-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty # https://github.com/ammarfaizi2/linux-block/commit/22b0856d76843b1ec4c7f0c379059f2d6114cfaf git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block brauner/linux/fs.xattr.simple.rework.rbtree git checkout 22b0856d76843b1ec4c7f0c379059f2d6114cfaf # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> fs/xattr.c:1099:23: sparse: sparse: incompatible types in comparison expression (different address spaces): >> fs/xattr.c:1099:23: sparse: struct rb_node [noderef] __rcu * >> fs/xattr.c:1099:23: sparse: struct rb_node * fs/xattr.c:1103:39: sparse: sparse: incompatible types in comparison expression (different address spaces): fs/xattr.c:1103:39: sparse: struct rb_node [noderef] __rcu * fs/xattr.c:1103:39: sparse: struct rb_node * fs/xattr.c:1105:39: sparse: sparse: incompatible types in comparison expression (different address spaces): fs/xattr.c:1105:39: sparse: struct rb_node [noderef] __rcu * fs/xattr.c:1105:39: sparse: struct rb_node * fs/xattr.c: note: in included file (through include/linux/rculist.h, include/linux/dcache.h, include/linux/fs.h): include/linux/rcupdate.h:769:9: sparse: sparse: context imbalance in 'simple_xattr_get' - different lock contexts for basic block fs/xattr.c: note: in included file (through include/linux/mm_types.h, include/linux/mmzone.h, include/linux/gfp.h, ...): include/linux/rbtree.h:74:9: sparse: sparse: incompatible types in comparison expression (different address spaces): include/linux/rbtree.h:74:9: sparse: struct rb_node [noderef] __rcu * include/linux/rbtree.h:74:9: sparse: struct rb_node * include/linux/rbtree.h:74:9: sparse: sparse: incompatible types in comparison expression (different address spaces): include/linux/rbtree.h:74:9: sparse: struct rb_node [noderef] __rcu * include/linux/rbtree.h:74:9: sparse: struct rb_node * vim +1099 fs/xattr.c 1074 1075 /** 1076 * simple_xattr_get - get an xattr object 1077 * @xattrs: the header of the xattr object 1078 * @name: the name of the xattr to retrieve 1079 * @buffer: the buffer to store the value into 1080 * @size: the size of @buffer 1081 * 1082 * Try to find and retrieve the xattr object associated with @name. If the 1083 * object is found and still in the rbtree bump the reference count. 1084 * 1085 * If @buffer is provided store the value of @xattr in @buffer. 1086 * 1087 * Return: On success zero and on error a negative error code is returned. 1088 */ 1089 int simple_xattr_get(struct simple_xattrs *xattrs, const char *name, 1090 void *buffer, size_t size) 1091 { 1092 struct simple_xattr *xattr = NULL; 1093 struct rb_node *rbp; 1094 int ret, seq = 0; 1095 1096 rcu_read_lock(); 1097 do { 1098 read_seqbegin_or_lock(&xattrs->lock, &seq); > 1099 rbp = rcu_dereference(xattrs->rb_root.rb_node); 1100 while (rbp) { 1101 xattr = rb_entry(rbp, struct simple_xattr, rb_node); 1102 if (strcmp(xattr->name, name) < 0) { 1103 rbp = rcu_dereference(rbp->rb_left); 1104 } else if (strcmp(xattr->name, name) > 0) { 1105 rbp = rcu_dereference(rbp->rb_right); 1106 } else { 1107 if (!likely(refcount_inc_not_zero(&xattr->ref))) 1108 xattr = NULL; 1109 break; 1110 } 1111 xattr = NULL; 1112 } 1113 } while (need_seqretry(&xattrs->lock, seq)); 1114 done_seqretry(&xattrs->lock, seq); 1115 rcu_read_unlock(); 1116 1117 if (!xattr) 1118 return -ENODATA; 1119 1120 ret = xattr->size; 1121 if (buffer) { 1122 if (size < xattr->size) 1123 ret = -ERANGE; 1124 else 1125 memcpy(buffer, xattr->value, xattr->size); 1126 } 1127 1128 put_simple_xattr_rcu(xattr); 1129 return ret; 1130 } 1131 -- 0-DAY CI Kernel Test Service https://01.org/lkp