tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub head: d404c6b945070ba14d8db1ee79daa5df149877df commit: e55ee1f9d09eea71aaf4056199caf105fe40e18a [38/308] xfs: repair refcount btrees config: i386-randconfig-r005-20211017 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 746dd6a700931988dd9021d3d04718f1929885a5) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=e55ee1f9d09eea71aaf4056199caf105fe40e18a git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git git fetch --no-tags djwong-xfs vectorized-scrub git checkout e55ee1f9d09eea71aaf4056199caf105fe40e18a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Note: the djwong-xfs/vectorized-scrub HEAD d404c6b945070ba14d8db1ee79daa5df149877df builds fine. It only hurts bisectability. All errors (new ones prefixed by >>): >> fs/xfs/scrub/refcount_repair.c:339:12: error: implicit declaration of function 'xfarray_insert_anywhere' [-Werror,-Wimplicit-function-declaration] error = xfarray_insert_anywhere(rmap_bag, &rrm); ^ fs/xfs/scrub/refcount_repair.c:339:12: note: did you mean 'xfarray_store_anywhere'? fs/xfs/scrub/xfarray.h:27:5: note: 'xfarray_store_anywhere' declared here int xfarray_store_anywhere(struct xfarray *array, void *ptr); ^ fs/xfs/scrub/refcount_repair.c:386:13: error: implicit declaration of function 'xfarray_insert_anywhere' [-Werror,-Wimplicit-function-declaration] error = xfarray_insert_anywhere(rmap_bag, ^ >> fs/xfs/scrub/refcount_repair.c:452:9: error: implicit declaration of function 'xfarray_iter_get' [-Werror,-Wimplicit-function-declaration] return xfarray_iter_get(rr->refcount_records, &rr->iter, ^ fs/xfs/scrub/refcount_repair.c:452:9: note: did you mean 'xfarray_store'? fs/xfs/scrub/xfarray.h:26:5: note: 'xfarray_store' declared here int xfarray_store(struct xfarray *array, uint64_t idx, void *ptr); ^ 3 errors generated. vim +/xfarray_insert_anywhere +339 fs/xfs/scrub/refcount_repair.c 296 297 /* Iterate all the rmap records to generate reference count data. */ 298 STATIC int 299 xrep_refc_find_refcounts( 300 struct xrep_refc *rr) 301 { 302 struct xrep_refc_rmap rrm; 303 struct xfs_scrub *sc = rr->sc; 304 struct xfarray *rmap_bag; 305 xfs_agblock_t sbno; 306 xfs_agblock_t cbno; 307 xfs_agblock_t nbno; 308 size_t old_stack_sz; 309 size_t stack_sz = 0; 310 bool have; 311 int have_gt; 312 int error; 313 314 xrep_ag_btcur_init(sc, &sc->sa); 315 316 /* Set up some storage */ 317 rmap_bag = xfarray_create("rmap bag", sizeof(struct xrep_refc_rmap)); 318 if (IS_ERR(rmap_bag)) { 319 error = PTR_ERR(rmap_bag); 320 goto out_cur; 321 } 322 323 /* Start the rmapbt cursor to the left of all records. */ 324 error = xfs_rmap_lookup_le(sc->sa.rmap_cur, 0, 0, 0, 0, NULL, &have_gt); 325 if (error) 326 goto out_bag; 327 ASSERT(have_gt == 0); 328 329 /* Process reverse mappings into refcount data. */ 330 while (xfs_btree_has_more_records(sc->sa.rmap_cur)) { 331 /* Push all rmaps with pblk == sbno onto the stack */ 332 error = xrep_refc_next_rrm(sc->sa.rmap_cur, rr, &rrm, &have); 333 if (error) 334 goto out_bag; 335 if (!have) 336 break; 337 sbno = cbno = rrm.startblock; 338 while (have && rrm.startblock == sbno) { > 339 error = xfarray_insert_anywhere(rmap_bag, &rrm); 340 if (error) 341 goto out_bag; 342 stack_sz++; 343 error = xrep_refc_next_rrm(sc->sa.rmap_cur, rr, &rrm, 344 &have); 345 if (error) 346 goto out_bag; 347 } 348 error = xfs_btree_decrement(sc->sa.rmap_cur, 0, &have_gt); 349 if (error) 350 goto out_bag; 351 if (XFS_IS_CORRUPT(sc->mp, !have_gt)) { 352 error = -EFSCORRUPTED; 353 goto out_bag; 354 } 355 356 /* Set nbno to the bno of the next refcount change */ 357 nbno = xrep_refc_next_edge(rmap_bag, &rrm, have); 358 if (nbno == NULLAGBLOCK) { 359 error = -EFSCORRUPTED; 360 goto out_bag; 361 } 362 363 ASSERT(nbno > sbno); 364 old_stack_sz = stack_sz; 365 366 /* While stack isn't empty... */ 367 while (stack_sz) { 368 uint64_t i; 369 370 /* Pop all rmaps that end at nbno */ 371 foreach_xfarray_item(rmap_bag, i, rrm) { 372 if (RRM_NEXT(rrm) != nbno) 373 continue; 374 error = xfarray_nullify(rmap_bag, i); 375 if (error) 376 goto out_bag; 377 stack_sz--; 378 } 379 380 /* Push array items that start at nbno */ 381 error = xrep_refc_next_rrm(sc->sa.rmap_cur, rr, &rrm, 382 &have); 383 if (error) 384 goto out_bag; 385 while (have && rrm.startblock == nbno) { 386 error = xfarray_insert_anywhere(rmap_bag, 387 &rrm); 388 if (error) 389 goto out_bag; 390 stack_sz++; 391 error = xrep_refc_next_rrm(sc->sa.rmap_cur, rr, 392 &rrm, &have); 393 if (error) 394 goto out_bag; 395 } 396 error = xfs_btree_decrement(sc->sa.rmap_cur, 0, 397 &have_gt); 398 if (error) 399 goto out_bag; 400 if (XFS_IS_CORRUPT(sc->mp, !have_gt)) { 401 error = -EFSCORRUPTED; 402 goto out_bag; 403 } 404 405 /* Emit refcount if necessary */ 406 ASSERT(nbno > cbno); 407 if (stack_sz != old_stack_sz) { 408 if (old_stack_sz > 1) { 409 error = xrep_refc_stash(rr, cbno, 410 nbno - cbno, 411 old_stack_sz); 412 if (error) 413 goto out_bag; 414 } 415 cbno = nbno; 416 } 417 418 /* Stack empty, go find the next rmap */ 419 if (stack_sz == 0) 420 break; 421 old_stack_sz = stack_sz; 422 sbno = nbno; 423 424 /* Set nbno to the bno of the next refcount change */ 425 nbno = xrep_refc_next_edge(rmap_bag, &rrm, have); 426 if (nbno == NULLAGBLOCK) { 427 error = -EFSCORRUPTED; 428 goto out_bag; 429 } 430 431 ASSERT(nbno > sbno); 432 } 433 } 434 435 ASSERT(stack_sz == 0); 436 out_bag: 437 xfarray_destroy(rmap_bag); 438 out_cur: 439 xchk_ag_btcur_free(&sc->sa); 440 return error; 441 } 442 #undef RRM_NEXT 443 444 /* Retrieve refcountbt data for bulk load. */ 445 STATIC int 446 xrep_refc_get_record( 447 struct xfs_btree_cur *cur, 448 void *priv) 449 { 450 struct xrep_refc *rr = priv; 451 > 452 return xfarray_iter_get(rr->refcount_records, &rr->iter, 453 &cur->bc_rec.rc); 454 } 455 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org