[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202201310744.lVDnY8qA-lkp@intel.com>
Date: Mon, 31 Jan 2022 07:39:43 +0800
From: kernel test robot <lkp@...el.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: kbuild-all@...ts.01.org,
"Darrick J. Wong" <darrick.wong@...cle.com>,
linux-kernel@...r.kernel.org
Subject: [djwong-xfs:vectorized-scrub 29/346] fs/xfs/scrub/agheader.c:741:25:
sparse: sparse: restricted gfp_t degrades to integer
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: 81e1a6295557a8263b17d815d60dbcbcd09faa08
commit: ace0a2769c4dcecf591c6ee9dbaf7247ba999eb2 [29/346] xfs: don't track the AGFL buffer in the scrub AG context
config: sparc64-randconfig-s031-20220130 (https://download.01.org/0day-ci/archive/20220131/202201310744.lVDnY8qA-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=ace0a2769c4dcecf591c6ee9dbaf7247ba999eb2
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout ace0a2769c4dcecf591c6ee9dbaf7247ba999eb2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc64 SHELL=/bin/bash fs/xfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> fs/xfs/scrub/agheader.c:741:25: sparse: sparse: restricted gfp_t degrades to integer
>> fs/xfs/scrub/agheader.c:741:34: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted gfp_t [usertype] flags @@ got unsigned int @@
fs/xfs/scrub/agheader.c:741:34: sparse: expected restricted gfp_t [usertype] flags
fs/xfs/scrub/agheader.c:741:34: sparse: got unsigned int
fs/xfs/scrub/agheader.c:158:23: sparse: sparse: cast truncates bits from constant value (ffff3f8f becomes 3f8f)
vim +741 fs/xfs/scrub/agheader.c
701
702 /* Scrub the AGFL. */
703 int
704 xchk_agfl(
705 struct xfs_scrub *sc)
706 {
707 struct xchk_agfl_info sai = {
708 .sc = sc,
709 };
710 struct xfs_agf *agf;
711 xfs_agnumber_t agno = sc->sm->sm_agno;
712 unsigned int i;
713 int error;
714
715 /* Lock the AGF and AGI so that nobody can touch this AG. */
716 error = xchk_ag_read_headers(sc, agno, &sc->sa);
717 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
718 return error;
719 if (!sc->sa.agf_bp)
720 return -EFSCORRUPTED;
721
722 /* Try to read the AGFL, and verify its structure if we get it. */
723 error = xfs_alloc_read_agfl(sc->mp, sc->tp, agno, &sai.agfl_bp);
724 if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
725 return error;
726 xchk_buffer_recheck(sc, sai.agfl_bp);
727
728 xchk_agfl_xref(sc);
729
730 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
731 goto out;
732
733 /* Allocate buffer to ensure uniqueness of AGFL entries. */
734 agf = sc->sa.agf_bp->b_addr;
735 sai.agflcount = be32_to_cpu(agf->agf_flcount);
736 if (sai.agflcount > xfs_agfl_size(sc->mp)) {
737 xchk_block_set_corrupt(sc, sc->sa.agf_bp);
738 goto out;
739 }
740 sai.entries = kvcalloc(sai.agflcount, sizeof(xfs_agblock_t),
> 741 GFP_NOFS | ___GFP_RETRY_MAYFAIL);
742 if (!sai.entries) {
743 error = -ENOMEM;
744 goto out;
745 }
746
747 /* Check the blocks in the AGFL. */
748 error = xfs_agfl_walk(sc->mp, sc->sa.agf_bp->b_addr, sai.agfl_bp,
749 xchk_agfl_block, &sai);
750 if (error == -ECANCELED) {
751 error = 0;
752 goto out_free;
753 }
754 if (error)
755 goto out_free;
756
757 if (sai.agflcount != sai.nr_entries) {
758 xchk_block_set_corrupt(sc, sc->sa.agf_bp);
759 goto out_free;
760 }
761
762 /* Sort entries, check for duplicates. */
763 sort(sai.entries, sai.nr_entries, sizeof(sai.entries[0]),
764 xchk_agblock_cmp, NULL);
765 for (i = 1; i < sai.nr_entries; i++) {
766 if (sai.entries[i] == sai.entries[i - 1]) {
767 xchk_block_set_corrupt(sc, sc->sa.agf_bp);
768 break;
769 }
770 }
771
772 out_free:
773 kmem_free(sai.entries);
774 out:
775 return error;
776 }
777
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists