tree:
git://git.infradead.org/users/hch/xfs xfs-inode-shrink.4
head: ecab85085f418fe9e1f8461583b4eed1d85252a1
commit: aa97e672498c840ddf82c5edb5648c4f34d7fa9c [1/18] xfs: split xfs_imap_to_bp
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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
git remote add hch-xfs
git://git.infradead.org/users/hch/xfs
git fetch --no-tags hch-xfs xfs-inode-shrink.4
git checkout aa97e672498c840ddf82c5edb5648c4f34d7fa9c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/xfs/scrub/ialloc.c: In function 'xchk_iallocbt_check_cluster':
> fs/xfs/scrub/ialloc.c:215:22: warning: variable 'dip' set
but not used [-Wunused-but-set-variable]
215 | struct xfs_dinode *dip;
| ^~~
vim +/dip +215 fs/xfs/scrub/ialloc.c
3daa664191375d Darrick J. Wong 2017-10-17 199
b9454fe056bda3 Darrick J. Wong 2019-02-01 200 /*
b9454fe056bda3 Darrick J. Wong 2019-02-01 201 * Check that the holemask and freemask
of a hypothetical inode cluster match
b9454fe056bda3 Darrick J. Wong 2019-02-01 202 * what's actually on disk. If
sparse inodes are enabled, the cluster does
b9454fe056bda3 Darrick J. Wong 2019-02-01 203 * not actually have to map to inodes if
the corresponding holemask bit is set.
b9454fe056bda3 Darrick J. Wong 2019-02-01 204 *
b9454fe056bda3 Darrick J. Wong 2019-02-01 205 * @cluster_base is the first inode in
the cluster within the @irec.
b9454fe056bda3 Darrick J. Wong 2019-02-01 206 */
3daa664191375d Darrick J. Wong 2017-10-17 207 STATIC int
a1954242facb01 Darrick J. Wong 2019-02-01 208 xchk_iallocbt_check_cluster(
c517b3aa02cff1 Darrick J. Wong 2018-07-19 209 struct xchk_btree *bs,
a1954242facb01 Darrick J. Wong 2019-02-01 210 struct xfs_inobt_rec_incore *irec,
b9454fe056bda3 Darrick J. Wong 2019-02-01 211 unsigned int cluster_base)
3daa664191375d Darrick J. Wong 2017-10-17 212 {
3daa664191375d Darrick J. Wong 2017-10-17 213 struct xfs_imap imap;
3daa664191375d Darrick J. Wong 2017-10-17 214 struct xfs_mount *mp =
bs->cur->bc_mp;
3daa664191375d Darrick J. Wong 2017-10-17 @215 struct xfs_dinode *dip;
b9454fe056bda3 Darrick J. Wong 2019-02-01 216 struct xfs_buf *cluster_bp;
a1954242facb01 Darrick J. Wong 2019-02-01 217 unsigned int nr_inodes;
576af732280760 Dave Chinner 2020-03-10 218 xfs_agnumber_t agno =
bs->cur->bc_ag.agno;
3daa664191375d Darrick J. Wong 2017-10-17 219 xfs_agblock_t agbno;
b9454fe056bda3 Darrick J. Wong 2019-02-01 220 unsigned int cluster_index;
b9454fe056bda3 Darrick J. Wong 2019-02-01 221 uint16_t cluster_mask = 0;
3daa664191375d Darrick J. Wong 2017-10-17 222 uint16_t ir_holemask;
3daa664191375d Darrick J. Wong 2017-10-17 223 int error = 0;
3daa664191375d Darrick J. Wong 2017-10-17 224
435dcf0787fde2 Darrick J. Wong 2019-02-01 225 nr_inodes = min_t(unsigned int,
XFS_INODES_PER_CHUNK,
ef325959993edd Darrick J. Wong 2019-06-05 226 M_IGEO(mp)->inodes_per_cluster);
3daa664191375d Darrick J. Wong 2017-10-17 227
b9454fe056bda3 Darrick J. Wong 2019-02-01 228 /* Map this inode cluster */
b9454fe056bda3 Darrick J. Wong 2019-02-01 229 agbno = XFS_AGINO_TO_AGBNO(mp,
irec->ir_startino + cluster_base);
3daa664191375d Darrick J. Wong 2017-10-17 230
b9454fe056bda3 Darrick J. Wong 2019-02-01 231 /* Compute a bitmask for this cluster
that can be used for holemask. */
b9454fe056bda3 Darrick J. Wong 2019-02-01 232 for (cluster_index = 0;
b9454fe056bda3 Darrick J. Wong 2019-02-01 233 cluster_index < nr_inodes;
b9454fe056bda3 Darrick J. Wong 2019-02-01 234 cluster_index +=
XFS_INODES_PER_HOLEMASK_BIT)
b9454fe056bda3 Darrick J. Wong 2019-02-01 235 cluster_mask |=
XFS_INOBT_MASK((cluster_base + cluster_index) /
3daa664191375d Darrick J. Wong 2017-10-17 236 XFS_INODES_PER_HOLEMASK_BIT);
3daa664191375d Darrick J. Wong 2017-10-17 237
f9e63342b85833 Darrick J. Wong 2019-02-01 238 /*
f9e63342b85833 Darrick J. Wong 2019-02-01 239 * Map the first inode of this cluster
to a buffer and offset.
f9e63342b85833 Darrick J. Wong 2019-02-01 240 * Be careful about inobt records that
don't align with the start of
f9e63342b85833 Darrick J. Wong 2019-02-01 241 * the inode buffer when block sizes
are large enough to hold multiple
f9e63342b85833 Darrick J. Wong 2019-02-01 242 * inode chunks. When this happens,
cluster_base will be zero but
f9e63342b85833 Darrick J. Wong 2019-02-01 243 * ir_startino can be large enough to
make im_boffset nonzero.
f9e63342b85833 Darrick J. Wong 2019-02-01 244 */
b9454fe056bda3 Darrick J. Wong 2019-02-01 245 ir_holemask = (irec->ir_holemask
& cluster_mask);
b9454fe056bda3 Darrick J. Wong 2019-02-01 246 imap.im_blkno = XFS_AGB_TO_DADDR(mp,
agno, agbno);
ef325959993edd Darrick J. Wong 2019-06-05 247 imap.im_len = XFS_FSB_TO_BB(mp,
M_IGEO(mp)->blocks_per_cluster);
025197ebb08a77 Darrick J. Wong 2019-06-03 248 imap.im_boffset = XFS_INO_TO_OFFSET(mp,
irec->ir_startino) <<
025197ebb08a77 Darrick J. Wong 2019-06-03 249 mp->m_sb.sb_inodelog;
f9e63342b85833 Darrick J. Wong 2019-02-01 250
f9e63342b85833 Darrick J. Wong 2019-02-01 251 if (imap.im_boffset != 0 &&
cluster_base != 0) {
f9e63342b85833 Darrick J. Wong 2019-02-01 252 ASSERT(imap.im_boffset == 0 ||
cluster_base == 0);
f9e63342b85833 Darrick J. Wong 2019-02-01 253 xchk_btree_set_corrupt(bs->sc,
bs->cur, 0);
f9e63342b85833 Darrick J. Wong 2019-02-01 254 return 0;
f9e63342b85833 Darrick J. Wong 2019-02-01 255 }
b9454fe056bda3 Darrick J. Wong 2019-02-01 256
b9454fe056bda3 Darrick J. Wong 2019-02-01 257 trace_xchk_iallocbt_check_cluster(mp,
agno, irec->ir_startino,
b9454fe056bda3 Darrick J. Wong 2019-02-01 258 imap.im_blkno, imap.im_len,
cluster_base, nr_inodes,
b9454fe056bda3 Darrick J. Wong 2019-02-01 259 cluster_mask, ir_holemask,
b9454fe056bda3 Darrick J. Wong 2019-02-01 260 XFS_INO_TO_OFFSET(mp,
irec->ir_startino +
b9454fe056bda3 Darrick J. Wong 2019-02-01 261 cluster_base));
b9454fe056bda3 Darrick J. Wong 2019-02-01 262
3daa664191375d Darrick J. Wong 2017-10-17 263 /* The whole cluster must be a hole or
not a hole. */
b9454fe056bda3 Darrick J. Wong 2019-02-01 264 if (ir_holemask != cluster_mask
&& ir_holemask != 0) {
c517b3aa02cff1 Darrick J. Wong 2018-07-19 265 xchk_btree_set_corrupt(bs->sc,
bs->cur, 0);
a1954242facb01 Darrick J. Wong 2019-02-01 266 return 0;
3daa664191375d Darrick J. Wong 2017-10-17 267 }
3daa664191375d Darrick J. Wong 2017-10-17 268
3daa664191375d Darrick J. Wong 2017-10-17 269 /* If any part of this is a hole, skip
it. */
d852657ccfc0e4 Darrick J. Wong 2018-01-16 270 if (ir_holemask) {
c517b3aa02cff1 Darrick J. Wong 2018-07-19 271 xchk_xref_is_not_owned_by(bs->sc,
agbno,
ef325959993edd Darrick J. Wong 2019-06-05 272 M_IGEO(mp)->blocks_per_cluster,
7280fedaf3a0f9 Darrick J. Wong 2018-12-12 273 &XFS_RMAP_OINFO_INODES);
a1954242facb01 Darrick J. Wong 2019-02-01 274 return 0;
d852657ccfc0e4 Darrick J. Wong 2018-01-16 275 }
d852657ccfc0e4 Darrick J. Wong 2018-01-16 276
ef325959993edd Darrick J. Wong 2019-06-05 277 xchk_xref_is_owned_by(bs->sc, agbno,
M_IGEO(mp)->blocks_per_cluster,
7280fedaf3a0f9 Darrick J. Wong 2018-12-12 278 &XFS_RMAP_OINFO_INODES);
3daa664191375d Darrick J. Wong 2017-10-17 279
3daa664191375d Darrick J. Wong 2017-10-17 280 /* Grab the inode cluster buffer. */
aa97e672498c84 Christoph Hellwig 2020-07-09 281 error = xfs_imap_to_bp(mp,
bs->cur->bc_tp, &imap, &cluster_bp);
aa97e672498c84 Christoph Hellwig 2020-07-09 282 if (!error)
aa97e672498c84 Christoph Hellwig 2020-07-09 283 dip = xfs_buf_offset(cluster_bp,
imap.im_boffset);
a1954242facb01 Darrick J. Wong 2019-02-01 284 if
(!xchk_btree_xref_process_error(bs->sc, bs->cur, 0, &error))
b9454fe056bda3 Darrick J. Wong 2019-02-01 285 return error;
3daa664191375d Darrick J. Wong 2017-10-17 286
b9454fe056bda3 Darrick J. Wong 2019-02-01 287 /* Check free status of each inode
within this cluster. */
b9454fe056bda3 Darrick J. Wong 2019-02-01 288 for (cluster_index = 0; cluster_index
< nr_inodes; cluster_index++) {
f9e63342b85833 Darrick J. Wong 2019-02-01 289 struct xfs_dinode *dip;
f9e63342b85833 Darrick J. Wong 2019-02-01 290
f9e63342b85833 Darrick J. Wong 2019-02-01 291 if (imap.im_boffset >=
BBTOB(cluster_bp->b_length)) {
f9e63342b85833 Darrick J. Wong 2019-02-01 292 xchk_btree_set_corrupt(bs->sc,
bs->cur, 0);
f9e63342b85833 Darrick J. Wong 2019-02-01 293 break;
f9e63342b85833 Darrick J. Wong 2019-02-01 294 }
f9e63342b85833 Darrick J. Wong 2019-02-01 295
f9e63342b85833 Darrick J. Wong 2019-02-01 296 dip = xfs_buf_offset(cluster_bp,
imap.im_boffset);
b9454fe056bda3 Darrick J. Wong 2019-02-01 297 error =
xchk_iallocbt_check_cluster_ifree(bs, irec,
f9e63342b85833 Darrick J. Wong 2019-02-01 298 cluster_base + cluster_index, dip);
a1954242facb01 Darrick J. Wong 2019-02-01 299 if (error)
a1954242facb01 Darrick J. Wong 2019-02-01 300 break;
f9e63342b85833 Darrick J. Wong 2019-02-01 301 imap.im_boffset +=
mp->m_sb.sb_inodesize;
a1954242facb01 Darrick J. Wong 2019-02-01 302 }
a1954242facb01 Darrick J. Wong 2019-02-01 303
b9454fe056bda3 Darrick J. Wong 2019-02-01 304 xfs_trans_brelse(bs->cur->bc_tp,
cluster_bp);
3daa664191375d Darrick J. Wong 2017-10-17 305 return error;
3daa664191375d Darrick J. Wong 2017-10-17 306 }
3daa664191375d Darrick J. Wong 2017-10-17 307
:::::: The code at line 215 was first introduced by commit
:::::: 3daa664191375db6a4a0cced75183aa3ca96cbda xfs: scrub inode btrees
:::::: TO: Darrick J. Wong <darrick.wong(a)oracle.com>
:::::: CC: Darrick J. Wong <darrick.wong(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org