tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 8bba4b17284e774544bd01d9ea5190546e93a849 commit: 62cbbf255badab153207e0a54d04da8c345ae307 [2610/2610] cachefiles: use mainline xattr in ondemand mode config: x86_64-buildonly-randconfig-001-20241230 (https://download.01.org/0day-ci/archive/20241231/202412310541.8ZI8Il3W-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241231/202412310541.8ZI8Il3W-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/202412310541.8ZI8Il3W-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/cachefiles/xattr.c:12: In file included from include/linux/fsnotify.h:16: In file included from include/linux/audit.h:13: In file included from include/linux/ptrace.h:10: In file included from include/linux/pid_namespace.h:7: In file included from include/linux/mm.h:1587: include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~
fs/cachefiles/xattr.c:221:5: warning: no previous prototype for function 'cachefiles_check_old_object_xattr' [-Wmissing-prototypes]
221 | int cachefiles_check_old_object_xattr(struct cachefiles_object *object, | ^ fs/cachefiles/xattr.c:221:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 221 | int cachefiles_check_old_object_xattr(struct cachefiles_object *object, | ^ | static 2 warnings generated.
vim +/cachefiles_check_old_object_xattr +221 fs/cachefiles/xattr.c
220
221 int cachefiles_check_old_object_xattr(struct cachefiles_object *object,
222 struct cachefiles_xattr *auxdata) 223 { 224 struct cachefiles_xattr *auxbuf; 225 unsigned int len = sizeof(struct cachefiles_xattr) + 512; 226 struct dentry *dentry = object->dentry; 227 int ret; 228 229 auxbuf = kmalloc(len, cachefiles_gfp); 230 if (!auxbuf) 231 return -ENOMEM; 232 233 /* read the current type label */ 234 ret = vfs_getxattr(dentry, cachefiles_xattr_cache, 235 &auxbuf->type, 512 + 1); 236 if (ret < 0) 237 goto error; 238 239 /* check the on-disk object */ 240 if (ret < 1) { 241 pr_err("Cache object %lu xattr length incorrect\n", 242 d_backing_inode(dentry)->i_ino); 243 goto stale; 244 } 245 246 if (auxbuf->type != auxdata->type) 247 goto stale; 248 249 auxbuf->len = ret; 250 251 /* consult the netfs */ 252 if (object->fscache.cookie->def->check_aux) { 253 enum fscache_checkaux result; 254 unsigned int dlen; 255 256 dlen = auxbuf->len - 1; 257 258 _debug("checkaux %s #%u", 259 object->fscache.cookie->def->name, dlen); 260 261 result = fscache_check_aux(&object->fscache, 262 &auxbuf->data, dlen, 263 i_size_read(d_backing_inode(dentry))); 264 265 switch (result) { 266 /* entry okay as is */ 267 case FSCACHE_CHECKAUX_OKAY: 268 goto okay; 269 270 /* entry requires update */ 271 case FSCACHE_CHECKAUX_NEEDS_UPDATE: 272 break; 273 274 /* entry requires deletion */ 275 case FSCACHE_CHECKAUX_OBSOLETE: 276 goto stale; 277 278 default: 279 BUG(); 280 } 281 282 /* update the current label */ 283 ret = vfs_setxattr(dentry, cachefiles_xattr_cache, 284 &auxdata->type, auxdata->len, 285 XATTR_REPLACE); 286 if (ret < 0) { 287 cachefiles_io_error_obj(object, 288 "Can't update xattr on %lu" 289 " (error %d)", 290 d_backing_inode(dentry)->i_ino, -ret); 291 goto error; 292 } 293 } 294 295 okay: 296 ret = 0; 297 298 error: 299 kfree(auxbuf); 300 return ret; 301 302 stale: 303 ret = -ESTALE; 304 goto error; 305 } 306