tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: ed8467e701e8f5ed9f2b39cf55710a156fc2593f commit: 2937cd5f8c58bd8e7895f6b2698057721442248e [2668/2668] cachefiles: notify the user daemon when looking up cookie config: x86_64-randconfig-121-20250108 (https://download.01.org/0day-ci/archive/20250108/202501081846.dn5sbz8W-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250108/202501081846.dn5sbz8W-lkp@i...)
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@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202501081846.dn5sbz8W-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
fs/cachefiles/ondemand.c:211:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/ondemand.c:211:9: sparse: expected void **slot fs/cachefiles/ondemand.c:211:9: sparse: got void [noderef] __rcu **
fs/cachefiles/ondemand.c:211:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/ondemand.c:211:9: sparse: expected void **slot fs/cachefiles/ondemand.c:211:9: sparse: got void [noderef] __rcu **
fs/cachefiles/ondemand.c:213:55: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __rcu **slot @@ got void **slot @@
fs/cachefiles/ondemand.c:213:55: sparse: expected void [noderef] __rcu **slot fs/cachefiles/ondemand.c:213:55: sparse: got void **slot fs/cachefiles/ondemand.c:211:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __rcu **slot @@ got void **slot @@ fs/cachefiles/ondemand.c:211:9: sparse: expected void [noderef] __rcu **slot fs/cachefiles/ondemand.c:211:9: sparse: got void **slot
fs/cachefiles/ondemand.c:211:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/ondemand.c:211:9: sparse: expected void **slot fs/cachefiles/ondemand.c:211:9: sparse: got void [noderef] __rcu ** --
fs/cachefiles/daemon.c:155:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/daemon.c:155:9: sparse: expected void **slot fs/cachefiles/daemon.c:155:9: sparse: got void [noderef] __rcu **
fs/cachefiles/daemon.c:155:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/daemon.c:155:9: sparse: expected void **slot fs/cachefiles/daemon.c:155:9: sparse: got void [noderef] __rcu **
fs/cachefiles/daemon.c:156:55: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __rcu **slot @@ got void **slot @@
fs/cachefiles/daemon.c:156:55: sparse: expected void [noderef] __rcu **slot fs/cachefiles/daemon.c:156:55: sparse: got void **slot fs/cachefiles/daemon.c:155:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __rcu **slot @@ got void **slot @@ fs/cachefiles/daemon.c:155:9: sparse: expected void [noderef] __rcu **slot fs/cachefiles/daemon.c:155:9: sparse: got void **slot
fs/cachefiles/daemon.c:155:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/cachefiles/daemon.c:155:9: sparse: expected void **slot fs/cachefiles/daemon.c:155:9: sparse: got void [noderef] __rcu **
vim +211 fs/cachefiles/ondemand.c
194 195 ssize_t cachefiles_ondemand_daemon_read(struct cachefiles_cache *cache, 196 char __user *_buffer, size_t buflen, loff_t *pos) 197 { 198 struct cachefiles_req *req; 199 struct cachefiles_msg *msg; 200 unsigned long id = 0; 201 size_t n; 202 int ret = 0; 203 struct radix_tree_iter iter; 204 void **slot; 205 206 /* 207 * Search for a request that has not ever been processed, to prevent 208 * requests from being processed repeatedly. 209 */ 210 xa_lock(&cache->reqs);
211 radix_tree_for_each_tagged(slot, &cache->reqs, &iter, 0,
212 CACHEFILES_REQ_NEW) {
213 req = radix_tree_deref_slot_protected(slot,
214 &cache->reqs.xa_lock); 215 216 msg = &req->msg; 217 n = msg->len; 218 219 if (n > buflen) { 220 xa_unlock(&cache->reqs); 221 return -EMSGSIZE; 222 } 223 224 radix_tree_iter_tag_clear(&cache->reqs, &iter, 225 CACHEFILES_REQ_NEW); 226 xa_unlock(&cache->reqs); 227 228 id = iter.index; 229 msg->msg_id = id; 230 231 if (msg->opcode == CACHEFILES_OP_OPEN) { 232 ret = cachefiles_ondemand_get_fd(req); 233 if (ret) 234 goto error; 235 } 236 237 if (copy_to_user(_buffer, msg, n) != 0) { 238 ret = -EFAULT; 239 goto err_put_fd; 240 } 241 return n; 242 } 243 xa_unlock(&cache->reqs); 244 return 0; 245 246 err_put_fd: 247 if (msg->opcode == CACHEFILES_OP_OPEN) 248 __close_fd(current->files, 249 ((struct cachefiles_open *)msg->data)->fd); 250 error: 251 xa_lock(&cache->reqs); 252 radix_tree_delete(&cache->reqs, id); 253 xa_unlock(&cache->reqs); 254 req->error = ret; 255 complete(&req->done); 256 return ret; 257 } 258