fs/xfs/xfs_iwalk.c:355:42: warning: variable 'irec' set but not used

From: kernel test robot
Date: Mon Sep 27 2021 - 09:31:08 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: 27c14b5daa82861220d6fa6e27b51f05f21ffaa7 xfs: ensure inobt record walks always make forward progress
date: 10 months ago
config: h8300-randconfig-r014-20210927 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.0
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/torvalds/linux.git/commit/?id=27c14b5daa82861220d6fa6e27b51f05f21ffaa7
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 27c14b5daa82861220d6fa6e27b51f05f21ffaa7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=h8300

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

fs/xfs/xfs_iwalk.c: In function 'xfs_iwalk_run_callbacks':
>> fs/xfs/xfs_iwalk.c:355:42: warning: variable 'irec' set but not used [-Wunused-but-set-variable]
355 | struct xfs_inobt_rec_incore *irec;
| ^~~~


vim +/irec +355 fs/xfs/xfs_iwalk.c

a211432c27ffa32d Darrick J. Wong 2019-07-02 336
a211432c27ffa32d Darrick J. Wong 2019-07-02 337 /*
a211432c27ffa32d Darrick J. Wong 2019-07-02 338 * The inobt record cache is full, so preserve the inobt cursor state and
a211432c27ffa32d Darrick J. Wong 2019-07-02 339 * run callbacks on the cached inobt records. When we're done, restore the
a211432c27ffa32d Darrick J. Wong 2019-07-02 340 * cursor state to wherever the cursor would have been had the cache not been
a211432c27ffa32d Darrick J. Wong 2019-07-02 341 * full (and therefore we could've just incremented the cursor) if *@has_more
a211432c27ffa32d Darrick J. Wong 2019-07-02 342 * is true. On exit, *@has_more will indicate whether or not the caller should
a211432c27ffa32d Darrick J. Wong 2019-07-02 343 * try for more inode records.
a211432c27ffa32d Darrick J. Wong 2019-07-02 344 */
a211432c27ffa32d Darrick J. Wong 2019-07-02 345 STATIC int
a211432c27ffa32d Darrick J. Wong 2019-07-02 346 xfs_iwalk_run_callbacks(
a211432c27ffa32d Darrick J. Wong 2019-07-02 347 struct xfs_iwalk_ag *iwag,
a211432c27ffa32d Darrick J. Wong 2019-07-02 348 xfs_agnumber_t agno,
a211432c27ffa32d Darrick J. Wong 2019-07-02 349 struct xfs_btree_cur **curpp,
a211432c27ffa32d Darrick J. Wong 2019-07-02 350 struct xfs_buf **agi_bpp,
a211432c27ffa32d Darrick J. Wong 2019-07-02 351 int *has_more)
a211432c27ffa32d Darrick J. Wong 2019-07-02 352 {
a211432c27ffa32d Darrick J. Wong 2019-07-02 353 struct xfs_mount *mp = iwag->mp;
a211432c27ffa32d Darrick J. Wong 2019-07-02 354 struct xfs_trans *tp = iwag->tp;
a211432c27ffa32d Darrick J. Wong 2019-07-02 @355 struct xfs_inobt_rec_incore *irec;
27c14b5daa828612 Darrick J. Wong 2020-11-14 356 xfs_agino_t next_agino;
a211432c27ffa32d Darrick J. Wong 2019-07-02 357 int error;
a211432c27ffa32d Darrick J. Wong 2019-07-02 358
27c14b5daa828612 Darrick J. Wong 2020-11-14 359 next_agino = XFS_INO_TO_AGINO(mp, iwag->lastino) + 1;
27c14b5daa828612 Darrick J. Wong 2020-11-14 360
a211432c27ffa32d Darrick J. Wong 2019-07-02 361 ASSERT(iwag->nr_recs > 0);
a211432c27ffa32d Darrick J. Wong 2019-07-02 362
a211432c27ffa32d Darrick J. Wong 2019-07-02 363 /* Delete cursor but remember the last record we cached... */
a211432c27ffa32d Darrick J. Wong 2019-07-02 364 xfs_iwalk_del_inobt(tp, curpp, agi_bpp, 0);
a211432c27ffa32d Darrick J. Wong 2019-07-02 365 irec = &iwag->recs[iwag->nr_recs - 1];
27c14b5daa828612 Darrick J. Wong 2020-11-14 366 ASSERT(next_agino == irec->ir_startino + XFS_INODES_PER_CHUNK);
a211432c27ffa32d Darrick J. Wong 2019-07-02 367
a211432c27ffa32d Darrick J. Wong 2019-07-02 368 error = xfs_iwalk_ag_recs(iwag);
a211432c27ffa32d Darrick J. Wong 2019-07-02 369 if (error)
a211432c27ffa32d Darrick J. Wong 2019-07-02 370 return error;
a211432c27ffa32d Darrick J. Wong 2019-07-02 371
a211432c27ffa32d Darrick J. Wong 2019-07-02 372 /* ...empty the cache... */
a211432c27ffa32d Darrick J. Wong 2019-07-02 373 iwag->nr_recs = 0;
a211432c27ffa32d Darrick J. Wong 2019-07-02 374
a211432c27ffa32d Darrick J. Wong 2019-07-02 375 if (!has_more)
a211432c27ffa32d Darrick J. Wong 2019-07-02 376 return 0;
a211432c27ffa32d Darrick J. Wong 2019-07-02 377
a211432c27ffa32d Darrick J. Wong 2019-07-02 378 /* ...and recreate the cursor just past where we left off. */
a211432c27ffa32d Darrick J. Wong 2019-07-02 379 error = xfs_inobt_cur(mp, tp, agno, XFS_BTNUM_INO, curpp, agi_bpp);
a211432c27ffa32d Darrick J. Wong 2019-07-02 380 if (error)
a211432c27ffa32d Darrick J. Wong 2019-07-02 381 return error;
a211432c27ffa32d Darrick J. Wong 2019-07-02 382
27c14b5daa828612 Darrick J. Wong 2020-11-14 383 return xfs_inobt_lookup(*curpp, next_agino, XFS_LOOKUP_GE, has_more);
a211432c27ffa32d Darrick J. Wong 2019-07-02 384 }
a211432c27ffa32d Darrick J. Wong 2019-07-02 385

:::::: The code at line 355 was first introduced by commit
:::::: a211432c27ffa32d9978f6c18f5af0c3f8ad2ad1 xfs: create simplified inode walk function

:::::: TO: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
:::::: CC: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip