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