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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211040048.FeUQMLE6-lkp@intel.com>
Date:   Fri, 4 Nov 2022 00:51:59 +0800
From:   kernel test robot <lkp@...el.com>
To:     Gao Xiang <hsiangkao@...ux.alibaba.com>, linux-xfs@...r.kernel.org,
        "Darrick J. Wong" <djwong@...nel.org>,
        Dave Chinner <dchinner@...hat.com>,
        Brian Foster <bfoster@...hat.com>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        LKML <linux-kernel@...r.kernel.org>,
        Zirong Lang <zlang@...hat.com>,
        Gao Xiang <hsiangkao@...ux.alibaba.com>
Subject: Re: [PATCH] xfs: extend the freelist before available space check

Hi Gao,

I love your patch! Perhaps something to improve:

[auto build test WARNING on xfs-linux/for-next]
[also build test WARNING on linus/master v6.1-rc3 next-20221103]
[cannot apply to djwong-xfs/djwong-devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gao-Xiang/xfs-extend-the-freelist-before-available-space-check/20221103-174840
base:   https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
patch link:    https://lore.kernel.org/r/20221103094639.39984-1-hsiangkao%40linux.alibaba.com
patch subject: [PATCH] xfs: extend the freelist before available space check
config: hexagon-randconfig-r004-20221102
compiler: clang version 15.0.4 (https://github.com/llvm/llvm-project 5c68a1cb123161b54b72ce90e7975d95a8eaf2a4)
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
        # https://github.com/intel-lab-lkp/linux/commit/427b4db33a93f832a6da62b2838bd5a558d024d9
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Gao-Xiang/xfs-extend-the-freelist-before-available-space-check/20221103-174840
        git checkout 427b4db33a93f832a6da62b2838bd5a558d024d9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon 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 >>):

   In file included from fs/xfs/libxfs/xfs_alloc.c:6:
   In file included from fs/xfs/xfs.h:22:
   In file included from fs/xfs/xfs_linux.h:31:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from fs/xfs/libxfs/xfs_alloc.c:6:
   In file included from fs/xfs/xfs.h:22:
   In file included from fs/xfs/xfs_linux.h:31:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from fs/xfs/libxfs/xfs_alloc.c:6:
   In file included from fs/xfs/xfs.h:22:
   In file included from fs/xfs/xfs_linux.h:31:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> fs/xfs/libxfs/xfs_alloc.c:2597:1: warning: no previous prototype for function 'xfs_fill_agfl' [-Wmissing-prototypes]
   xfs_fill_agfl(
   ^
   fs/xfs/libxfs/xfs_alloc.c:2596:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int
   ^
   static 
   7 warnings generated.


vim +/xfs_fill_agfl +2597 fs/xfs/libxfs/xfs_alloc.c

  2585	
  2586	/*
  2587	 * The freelist has to be in a good state before the available space check
  2588	 * since multiple allocations could be performed from a single AG and
  2589	 * transaction under certain conditions.  For example, A bmbt allocation
  2590	 * request made for inode extent to bmap format conversion after an extent
  2591	 * allocation is expected to be satisfied by the same AG.  Such bmap conversion
  2592	 * allocation can fail due to the available space check if allocbt required an
  2593	 * extra btree block from the freelist in the previous allocation but without
  2594	 * make the freelist longer.
  2595	 */
  2596	int
> 2597	xfs_fill_agfl(
  2598		struct xfs_alloc_arg    *args,
  2599		int			flags,
  2600		xfs_extlen_t		need,
  2601		struct xfs_buf          *agbp)
  2602	{
  2603		struct xfs_trans	*tp = args->tp;
  2604		struct xfs_perag	*pag = agbp->b_pag;
  2605		struct xfs_alloc_arg	targs = {
  2606			.tp		= tp,
  2607			.mp		= tp->t_mountp,
  2608			.agbp		= agbp,
  2609			.agno		= args->agno,
  2610			.alignment	= 1,
  2611			.minlen		= 1,
  2612			.prod		= 1,
  2613			.type		= XFS_ALLOCTYPE_THIS_AG,
  2614			.pag		= pag,
  2615		};
  2616		struct xfs_buf          *agflbp = NULL;
  2617		xfs_agblock_t		bno;
  2618		int error;
  2619	
  2620		if (flags & XFS_ALLOC_FLAG_NORMAP)
  2621			targs.oinfo = XFS_RMAP_OINFO_SKIP_UPDATE;
  2622		else
  2623			targs.oinfo = XFS_RMAP_OINFO_AG;
  2624	
  2625		error = xfs_alloc_read_agfl(pag, tp, &agflbp);
  2626		if (error)
  2627			return error;
  2628	
  2629		/* Make the freelist longer if it's too short. */
  2630		while (pag->pagf_flcount < need) {
  2631			targs.agbno = 0;
  2632			targs.maxlen = need - pag->pagf_flcount;
  2633			targs.resv = XFS_AG_RESV_AGFL;
  2634	
  2635			/* Allocate as many blocks as possible at once. */
  2636			error = xfs_alloc_ag_vextent(&targs);
  2637			if (error)
  2638				goto out_agflbp_relse;
  2639	
  2640			/*
  2641			 * Stop if we run out.  Won't happen if callers are obeying
  2642			 * the restrictions correctly.  Can happen for free calls
  2643			 * on a completely full ag.
  2644			 */
  2645			if (targs.agbno == NULLAGBLOCK) {
  2646				if (flags & XFS_ALLOC_FLAG_FREEING)
  2647					break;
  2648				error = -ENOSPC;
  2649				goto out_agflbp_relse;
  2650			}
  2651			/*
  2652			 * Put each allocated block on the list.
  2653			 */
  2654			for (bno = targs.agbno; bno < targs.agbno + targs.len; bno++) {
  2655				error = xfs_alloc_put_freelist(pag, tp, agbp,
  2656								agflbp, bno, 0);
  2657				if (error)
  2658					goto out_agflbp_relse;
  2659			}
  2660		}
  2661	out_agflbp_relse:
  2662		xfs_trans_brelse(tp, agflbp);
  2663		return error;
  2664	}
  2665	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ