lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207151904.7gQde3ZT-lkp@intel.com>
Date:   Fri, 15 Jul 2022 23:17:13 +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 192/378]
 fs/xfs/scrub/tempfile.c:458:13: warning: the comparison will always evaluate
 as 'true' for the address of 'i_df' will never be NULL

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head:   ca1f215ce72afdad027367230130cc8d9b49290a
commit: baa34ba11992618b9422a614e82c44964f5895f9 [192/378] xfs: online repair of realtime summaries
config: csky-randconfig-s053-20220715
compiler: csky-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=baa34ba11992618b9422a614e82c44964f5895f9
        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 baa34ba11992618b9422a614e82c44964f5895f9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash fs/xfs/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   fs/xfs/scrub/tempfile.c: In function 'xrep_tempswap_prep_request':
>> fs/xfs/scrub/tempfile.c:458:13: warning: the comparison will always evaluate as 'true' for the address of 'i_df' will never be NULL [-Waddress]
     458 |         if (!XFS_IFORK_PTR(sc->ip, whichfork) ||
         |             ^
   In file included from fs/xfs/scrub/tempfile.c:14:
   fs/xfs/xfs_inode.h:38:33: note: 'i_df' declared here
      38 |         struct xfs_ifork        i_df;           /* data fork */
         |                                 ^~~~
   fs/xfs/scrub/tempfile.c:459:13: warning: the comparison will always evaluate as 'true' for the address of 'i_df' will never be NULL [-Waddress]
     459 |             !XFS_IFORK_PTR(sc->tempip, whichfork)) {
         |             ^
   fs/xfs/xfs_inode.h:38:33: note: 'i_df' declared here
      38 |         struct xfs_ifork        i_df;           /* data fork */
         |                                 ^~~~


vim +458 fs/xfs/scrub/tempfile.c

   436	
   437	/*
   438	 * Fill out the swapext request in preparation for swapping the contents of a
   439	 * metadata file that we've rebuilt in the temp file.
   440	 */
   441	STATIC int
   442	xrep_tempswap_prep_request(
   443		struct xfs_scrub	*sc,
   444		int			whichfork,
   445		struct xrep_tempswap	*tx)
   446	{
   447		struct xfs_swapext_req	*req = &tx->req;
   448	
   449		memset(tx, 0, sizeof(struct xrep_tempswap));
   450	
   451		/* COW forks don't exist on disk. */
   452		if (whichfork == XFS_COW_FORK) {
   453			ASSERT(0);
   454			return -EINVAL;
   455		}
   456	
   457		/* Both files should have the relevant forks. */
 > 458		if (!XFS_IFORK_PTR(sc->ip, whichfork) ||
   459		    !XFS_IFORK_PTR(sc->tempip, whichfork)) {
   460			ASSERT(0);
   461			return -EINVAL;
   462		}
   463	
   464		/* Swap all mappings in both forks. */
   465		req->ip1 = sc->tempip;
   466		req->ip2 = sc->ip;
   467		req->startoff1 = 0;
   468		req->startoff2 = 0;
   469		req->whichfork = whichfork;
   470		req->blockcount = XFS_MAX_FILEOFF;
   471		req->req_flags = XFS_SWAP_REQ_LOGGED;
   472	
   473		/* Always swap sizes when we're swapping data fork mappings. */
   474		if (whichfork == XFS_DATA_FORK)
   475			req->req_flags |= XFS_SWAP_REQ_SET_SIZES;
   476	
   477		/*
   478		 * If we're repairing symlinks, xattrs, or directories, always try to
   479		 * convert ip2 to short format after swapping.
   480		 */
   481		if (whichfork == XFS_ATTR_FORK || S_ISDIR(VFS_I(sc->ip)->i_mode) ||
   482		    S_ISLNK(VFS_I(sc->ip)->i_mode))
   483			req->req_flags |= XFS_SWAP_REQ_CVT_INO2_SF;
   484	
   485		return 0;
   486	}
   487	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (147431 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ