[djwong-xfs:llm-fixes-26 145/152] fs/xfs/scrub/inode_repair.c:584:42: sparse: sparse: incorrect type in assignment (different base types)

kernel test robot <[email protected]> Fri, 31 Jul 2026 03:33:10 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git llm-fixes-26
head:   7f719c581807433d0c722404bea24449515f2c41
commit: a8cbef31a928e0bc0c07cf1c04878f47c0014b6c [145/152] xfs: zero out di_metatype when removing the metadir file iflag
config: mips-randconfig-r132-20260730 (https://download.01.org/0day-ci/archive/20260731/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project bacfe2950f8218268fcc0a8765644ea0c15f0360)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260731/[email protected]/reproduce)

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> fs/xfs/scrub/inode_repair.c:584:42: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] di_metatype @@     got restricted __be32 [usertype] @@
   fs/xfs/scrub/inode_repair.c:584:42: sparse:     expected restricted __be16 [usertype] di_metatype
   fs/xfs/scrub/inode_repair.c:584:42: sparse:     got restricted __be32 [usertype]

vim +584 fs/xfs/scrub/inode_repair.c

   539	
   540	/* Fix any conflicting flags that the verifiers complain about. */
   541	STATIC void
   542	xrep_dinode_flags(
   543		struct xfs_scrub	*sc,
   544		struct xfs_dinode	*dip,
   545		bool			isrt)
   546	{
   547		struct xfs_mount	*mp = sc->mp;
   548		uint64_t		flags2 = be64_to_cpu(dip->di_flags2);
   549		uint16_t		flags = be16_to_cpu(dip->di_flags);
   550		uint16_t		mode = be16_to_cpu(dip->di_mode);
   551	
   552		trace_xrep_dinode_flags(sc, dip);
   553	
   554		if (isrt)
   555			flags |= XFS_DIFLAG_REALTIME;
   556		else
   557			flags &= ~XFS_DIFLAG_REALTIME;
   558	
   559		/*
   560		 * For regular files on a reflink filesystem, set the REFLINK flag to
   561		 * protect shared extents.  A later stage will actually check those
   562		 * extents and clear the flag if possible.
   563		 */
   564		if (xfs_has_reflink(mp) && S_ISREG(mode))
   565			flags2 |= XFS_DIFLAG2_REFLINK;
   566		else
   567			flags2 &= ~(XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE);
   568		if (!xfs_has_bigtime(mp))
   569			flags2 &= ~XFS_DIFLAG2_BIGTIME;
   570		if (!xfs_has_large_extent_counts(mp))
   571			flags2 &= ~XFS_DIFLAG2_NREXT64;
   572		if (flags2 & XFS_DIFLAG2_NREXT64)
   573			dip->di_nrext64_pad = 0;
   574		else if (dip->di_version >= 3)
   575			dip->di_v3_pad = 0;
   576	
   577		if (flags2 & XFS_DIFLAG2_METADATA) {
   578			xfs_failaddr_t	fa;
   579	
   580			fa = xfs_dinode_verify_metadir(sc->mp, dip, mode, flags,
   581					flags2);
   582			if (fa) {
   583				flags2 &= ~XFS_DIFLAG2_METADATA;
 > 584				dip->di_metatype = cpu_to_be32(XFS_METAFILE_UNKNOWN);
   585			}
   586		}
   587	
   588		dip->di_flags = cpu_to_be16(flags);
   589		dip->di_flags2 = cpu_to_be64(flags2);
   590	}
   591	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki