tree:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git djwong-wtf
head: dc36d6ffb18ee08b34171a9355b844bbd4534baa
commit: 436a67de825c722c88c5033bbbbeabc235ae2644 [229/234] xfs: use atomic extent swapping
to repair directories
config: i386-randconfig-s002-20200526 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
git checkout 436a67de825c722c88c5033bbbbeabc235ae2644
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:752:36: sparse: sparse: cast to restricted __be64
> fs/xfs/scrub/dir_repair.c:752:34: sparse: sparse: incorrect type
in assignment (different base types) @@ expected restricted __be64 [usertype] owner @@
got unsigned long long @@
fs/xfs/scrub/dir_repair.c:752:34: sparse:
expected restricted __be64 [usertype] owner
fs/xfs/scrub/dir_repair.c:752:34: sparse: got unsigned long long
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:32: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:768:30: sparse: sparse: incorrect type in assignment
(different base types) @@ expected restricted __be64 [usertype] owner @@ got
unsigned long long @@
fs/xfs/scrub/dir_repair.c:768:30: sparse: expected restricted __be64 [usertype]
owner
fs/xfs/scrub/dir_repair.c:768:30: sparse: got unsigned long long
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:28: sparse: sparse: cast to restricted __be64
fs/xfs/scrub/dir_repair.c:777:26: sparse: sparse: incorrect type in assignment
(different base types) @@ expected restricted __be64 [usertype] owner @@ got
unsigned long long @@
fs/xfs/scrub/dir_repair.c:777:26: sparse: expected restricted __be64 [usertype]
owner
fs/xfs/scrub/dir_repair.c:777:26: sparse: got unsigned long long
fs/xfs/scrub/dir_repair.c:896:17: sparse: sparse: symbol 'xfs_name_dot' was not
declared. Should it be static?
vim +752 fs/xfs/scrub/dir_repair.c
712
713 /*
714 * Set the owner for this directory block to the directory being repaired.
715 * Return the magic number that we found, or the usual negative error.
716 */
717 STATIC int
718 xrep_dir_reset_owner(
719 struct xfs_scrub *sc,
720 xfs_dablk_t dabno,
721 struct xfs_buf *bp,
722 unsigned int *magic)
723 {
724 struct xfs_da_geometry *geo = sc->mp->m_dir_geo;
725 struct xfs_dir3_data_hdr *data3 = bp->b_addr;
726 struct xfs_da3_blkinfo *info3 = bp->b_addr;
727 struct xfs_dir3_free_hdr *free3 = bp->b_addr;
728 struct xfs_dir2_data_entry *dep;
729
730 /* Directory data blocks. */
731 if (dabno < geo->leafblk) {
732 *magic = be32_to_cpu(data3->hdr.magic);
733 if (*magic != XFS_DIR3_BLOCK_MAGIC &&
734 *magic != XFS_DIR3_DATA_MAGIC)
735 return -EFSCORRUPTED;
736
737 /*
738 * If this is a block format directory, it's possible that the
739 * block was created as part of converting the temp directory
740 * from short format to block format in order to use the atomic
741 * extent swap. In that case, the '.' entry will be set to
742 * the temp dir, so find the dot entry and reset it.
743 */
744 if (*magic == XFS_DIR3_BLOCK_MAGIC) {
745 dep = bp->b_addr + geo->data_entry_offset;
746 if (dep->namelen != 1 || dep->name[0] != '.')
747 return -EFSCORRUPTED;
748
749 dep->inumber = cpu_to_be64(sc->ip->i_ino);
750 }
751
752 data3->hdr.owner = be64_to_cpu(sc->ip->i_ino);
753 return 0;
754 }
755
756 /* Directory leaf and da node blocks. */
757 if (dabno < geo->freeblk) {
758 *magic = be16_to_cpu(info3->hdr.magic);
759 switch (*magic) {
760 case XFS_DA3_NODE_MAGIC:
761 case XFS_DIR3_LEAF1_MAGIC:
762 case XFS_DIR3_LEAFN_MAGIC:
763 break;
764 default:
765 return -EFSCORRUPTED;
766 }
767
768 info3->owner = be64_to_cpu(sc->ip->i_ino);
769 return 0;
770 }
771
772 /* Directory free blocks. */
773 *magic = be32_to_cpu(free3->hdr.magic);
774 if (*magic != XFS_DIR3_FREE_MAGIC)
775 return -EFSCORRUPTED;
776
777 free3->hdr.owner = be64_to_cpu(sc->ip->i_ino);
778 return 0;
779 }
780
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org