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: <202101281058.QUzWxzF7-lkp@intel.com>
Date:   Thu, 28 Jan 2021 10:22:10 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org,
        Nathan Chancellor <natechancellor@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>
Subject: fs/f2fs/gc.c:1358:12: warning: stack frame size of 1056 bytes in
 function 'gc_data_segment'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   76c057c84d286140c6c416c3b4ba832cd1d8984e
commit: cdf8a76fda4ae3b53c5a09e5a8c79e27b7b65d68 ubsan: move cc-option tests into Kconfig
date:   6 weeks ago
config: powerpc64-randconfig-r031-20210128 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 48bdd676a1d1338c10541460bf5beb69ac17e451)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cdf8a76fda4ae3b53c5a09e5a8c79e27b7b65d68
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout cdf8a76fda4ae3b53c5a09e5a8c79e27b7b65d68
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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

All warnings (new ones prefixed by >>):

   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:142:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/f2fs/gc.c:10:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:146:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/f2fs/gc.c:10:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:150:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/f2fs/gc.c:10:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:154:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/f2fs/gc.c:10:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:158:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> fs/f2fs/gc.c:1358:12: warning: stack frame size of 1056 bytes in function 'gc_data_segment' [-Wframe-larger-than=]
   static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
              ^
   7 warnings generated.
--
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:155:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/xfs/libxfs/xfs_bmap.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:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:159:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/xfs/libxfs/xfs_bmap.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:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:163:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/xfs/libxfs/xfs_bmap.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:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:167:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from fs/xfs/libxfs/xfs_bmap.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:14:
   In file included from include/linux/pagemap.h:11:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:171:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> fs/xfs/libxfs/xfs_bmap.c:5256:1: warning: stack frame size of 1296 bytes in function '__xfs_bunmapi' [-Wframe-larger-than=]
   __xfs_bunmapi(
   ^
   7 warnings generated.


vim +/gc_data_segment +1358 fs/f2fs/gc.c

7bc0900347e069 Jaegeuk Kim     2012-11-02  1350  
0a8165d7c2cf13 Jaegeuk Kim     2012-11-29  1351  /*
7bc0900347e069 Jaegeuk Kim     2012-11-02  1352   * This function tries to get parent node of victim data block, and identifies
7bc0900347e069 Jaegeuk Kim     2012-11-02  1353   * data block validity. If the block is valid, copy that with cold status and
7bc0900347e069 Jaegeuk Kim     2012-11-02  1354   * modify parent node.
7bc0900347e069 Jaegeuk Kim     2012-11-02  1355   * If the parent node is not valid or the data block address is different,
7bc0900347e069 Jaegeuk Kim     2012-11-02  1356   * the victim data block is ignored.
7bc0900347e069 Jaegeuk Kim     2012-11-02  1357   */
48018b4cfd07dd Chao Yu         2018-09-13 @1358  static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
7dda2af83b2b75 Changman Lee    2014-11-28  1359  		struct gc_inode_list *gc_list, unsigned int segno, int gc_type)
7bc0900347e069 Jaegeuk Kim     2012-11-02  1360  {
7bc0900347e069 Jaegeuk Kim     2012-11-02  1361  	struct super_block *sb = sbi->sb;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1362  	struct f2fs_summary *entry;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1363  	block_t start_addr;
437275272f9e63 Jaegeuk Kim     2013-02-04  1364  	int off;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1365  	int phase = 0;
48018b4cfd07dd Chao Yu         2018-09-13  1366  	int submitted = 0;
de881df97768d0 Aravind Ramesh  2020-07-16  1367  	unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1368  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1369  	start_addr = START_BLOCK(sbi, segno);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1370  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1371  next_step:
7bc0900347e069 Jaegeuk Kim     2012-11-02  1372  	entry = sum;
c718379b6b0954 Jaegeuk Kim     2013-04-24  1373  
de881df97768d0 Aravind Ramesh  2020-07-16  1374  	for (off = 0; off < usable_blks_in_seg; off++, entry++) {
7bc0900347e069 Jaegeuk Kim     2012-11-02  1375  		struct page *data_page;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1376  		struct inode *inode;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1377  		struct node_info dni; /* dnode info for the data */
7bc0900347e069 Jaegeuk Kim     2012-11-02  1378  		unsigned int ofs_in_node, nofs;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1379  		block_t start_bidx;
7ea984b0604ac3 Chao Yu         2016-08-27  1380  		nid_t nid = le32_to_cpu(entry->nid);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1381  
803e74be04b32f Jaegeuk Kim     2019-11-22  1382  		/*
803e74be04b32f Jaegeuk Kim     2019-11-22  1383  		 * stop BG_GC if there is not enough free sections.
803e74be04b32f Jaegeuk Kim     2019-11-22  1384  		 * Or, stop GC if the segment becomes fully valid caused by
803e74be04b32f Jaegeuk Kim     2019-11-22  1385  		 * race condition along with SSR block allocation.
803e74be04b32f Jaegeuk Kim     2019-11-22  1386  		 */
803e74be04b32f Jaegeuk Kim     2019-11-22  1387  		if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
2bac07635ddf9e Jaegeuk Kim     2020-02-09  1388  				get_valid_blocks(sbi, segno, true) ==
2bac07635ddf9e Jaegeuk Kim     2020-02-09  1389  							BLKS_PER_SEC(sbi))
48018b4cfd07dd Chao Yu         2018-09-13  1390  			return submitted;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1391  
437275272f9e63 Jaegeuk Kim     2013-02-04  1392  		if (check_valid_map(sbi, segno, off) == 0)
7bc0900347e069 Jaegeuk Kim     2012-11-02  1393  			continue;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1394  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1395  		if (phase == 0) {
4d57b86dd86404 Chao Yu         2018-05-30  1396  			f2fs_ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nid), 1,
7ea984b0604ac3 Chao Yu         2016-08-27  1397  							META_NAT, true);
7ea984b0604ac3 Chao Yu         2016-08-27  1398  			continue;
7ea984b0604ac3 Chao Yu         2016-08-27  1399  		}
7ea984b0604ac3 Chao Yu         2016-08-27  1400  
7ea984b0604ac3 Chao Yu         2016-08-27  1401  		if (phase == 1) {
4d57b86dd86404 Chao Yu         2018-05-30  1402  			f2fs_ra_node_page(sbi, nid);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1403  			continue;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1404  		}
7bc0900347e069 Jaegeuk Kim     2012-11-02  1405  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1406  		/* Get an inode by ino with checking validity */
c1079892f4e8ec Nicholas Krause 2015-06-30  1407  		if (!is_alive(sbi, entry, &dni, start_addr + off, &nofs))
7bc0900347e069 Jaegeuk Kim     2012-11-02  1408  			continue;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1409  
7ea984b0604ac3 Chao Yu         2016-08-27  1410  		if (phase == 2) {
4d57b86dd86404 Chao Yu         2018-05-30  1411  			f2fs_ra_node_page(sbi, dni.ino);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1412  			continue;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1413  		}
7bc0900347e069 Jaegeuk Kim     2012-11-02  1414  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1415  		ofs_in_node = le16_to_cpu(entry->ofs_in_node);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1416  
7ea984b0604ac3 Chao Yu         2016-08-27  1417  		if (phase == 3) {
d4686d56ec912d Jaegeuk Kim     2013-01-31  1418  			inode = f2fs_iget(sb, dni.ino);
4eea93e3ff98aa Jaegeuk Kim     2019-12-20  1419  			if (IS_ERR(inode) || is_bad_inode(inode)) {
4eea93e3ff98aa Jaegeuk Kim     2019-12-20  1420  				set_sbi_flag(sbi, SBI_NEED_FSCK);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1421  				continue;
4eea93e3ff98aa Jaegeuk Kim     2019-12-20  1422  			}
7bc0900347e069 Jaegeuk Kim     2012-11-02  1423  
bb06664a534ba4 Chao Yu         2017-11-03  1424  			if (!down_write_trylock(
b2532c694033fb Chao Yu         2018-04-24  1425  				&F2FS_I(inode)->i_gc_rwsem[WRITE])) {
bb06664a534ba4 Chao Yu         2017-11-03  1426  				iput(inode);
6f8d4455060dfb Jaegeuk Kim     2018-07-25  1427  				sbi->skipped_gc_rwsem++;
bb06664a534ba4 Chao Yu         2017-11-03  1428  				continue;
bb06664a534ba4 Chao Yu         2017-11-03  1429  			}
bb06664a534ba4 Chao Yu         2017-11-03  1430  
6aa58d8ad20a33 Chao Yu         2018-08-14  1431  			start_bidx = f2fs_start_bidx_of_node(nofs, inode) +
6aa58d8ad20a33 Chao Yu         2018-08-14  1432  								ofs_in_node;
6aa58d8ad20a33 Chao Yu         2018-08-14  1433  
6aa58d8ad20a33 Chao Yu         2018-08-14  1434  			if (f2fs_post_read_required(inode)) {
6aa58d8ad20a33 Chao Yu         2018-08-14  1435  				int err = ra_data_block(inode, start_bidx);
6aa58d8ad20a33 Chao Yu         2018-08-14  1436  
6aa58d8ad20a33 Chao Yu         2018-08-14  1437  				up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
6aa58d8ad20a33 Chao Yu         2018-08-14  1438  				if (err) {
6aa58d8ad20a33 Chao Yu         2018-08-14  1439  					iput(inode);
6aa58d8ad20a33 Chao Yu         2018-08-14  1440  					continue;
6aa58d8ad20a33 Chao Yu         2018-08-14  1441  				}
6aa58d8ad20a33 Chao Yu         2018-08-14  1442  				add_gc_inode(gc_list, inode);
6aa58d8ad20a33 Chao Yu         2018-08-14  1443  				continue;
6aa58d8ad20a33 Chao Yu         2018-08-14  1444  			}
6aa58d8ad20a33 Chao Yu         2018-08-14  1445  
4d57b86dd86404 Chao Yu         2018-05-30  1446  			data_page = f2fs_get_read_data_page(inode,
6aa58d8ad20a33 Chao Yu         2018-08-14  1447  						start_bidx, REQ_RAHEAD, true);
b2532c694033fb Chao Yu         2018-04-24  1448  			up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
31a3268839c1aa Changman Lee    2014-11-27  1449  			if (IS_ERR(data_page)) {
31a3268839c1aa Changman Lee    2014-11-27  1450  				iput(inode);
31a3268839c1aa Changman Lee    2014-11-27  1451  				continue;
31a3268839c1aa Changman Lee    2014-11-27  1452  			}
7bc0900347e069 Jaegeuk Kim     2012-11-02  1453  
7bc0900347e069 Jaegeuk Kim     2012-11-02  1454  			f2fs_put_page(data_page, 0);
7dda2af83b2b75 Changman Lee    2014-11-28  1455  			add_gc_inode(gc_list, inode);
31a3268839c1aa Changman Lee    2014-11-27  1456  			continue;
31a3268839c1aa Changman Lee    2014-11-27  1457  		}
31a3268839c1aa Changman Lee    2014-11-27  1458  
7ea984b0604ac3 Chao Yu         2016-08-27  1459  		/* phase 4 */
7dda2af83b2b75 Changman Lee    2014-11-28  1460  		inode = find_gc_inode(gc_list, dni.ino);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1461  		if (inode) {
82e0a5aa5ddf79 Chao Yu         2016-07-13  1462  			struct f2fs_inode_info *fi = F2FS_I(inode);
82e0a5aa5ddf79 Chao Yu         2016-07-13  1463  			bool locked = false;
48018b4cfd07dd Chao Yu         2018-09-13  1464  			int err;
82e0a5aa5ddf79 Chao Yu         2016-07-13  1465  
82e0a5aa5ddf79 Chao Yu         2016-07-13  1466  			if (S_ISREG(inode->i_mode)) {
b2532c694033fb Chao Yu         2018-04-24  1467  				if (!down_write_trylock(&fi->i_gc_rwsem[READ]))
82e0a5aa5ddf79 Chao Yu         2016-07-13  1468  					continue;
82e0a5aa5ddf79 Chao Yu         2016-07-13  1469  				if (!down_write_trylock(
b2532c694033fb Chao Yu         2018-04-24  1470  						&fi->i_gc_rwsem[WRITE])) {
6f8d4455060dfb Jaegeuk Kim     2018-07-25  1471  					sbi->skipped_gc_rwsem++;
b2532c694033fb Chao Yu         2018-04-24  1472  					up_write(&fi->i_gc_rwsem[READ]);
82e0a5aa5ddf79 Chao Yu         2016-07-13  1473  					continue;
82e0a5aa5ddf79 Chao Yu         2016-07-13  1474  				}
82e0a5aa5ddf79 Chao Yu         2016-07-13  1475  				locked = true;
73ac2f4e8256b9 Chao Yu         2017-08-23  1476  
73ac2f4e8256b9 Chao Yu         2017-08-23  1477  				/* wait for all inflight aio data */
73ac2f4e8256b9 Chao Yu         2017-08-23  1478  				inode_dio_wait(inode);
82e0a5aa5ddf79 Chao Yu         2016-07-13  1479  			}
82e0a5aa5ddf79 Chao Yu         2016-07-13  1480  
4d57b86dd86404 Chao Yu         2018-05-30  1481  			start_bidx = f2fs_start_bidx_of_node(nofs, inode)
c879f90da96c63 Jaegeuk Kim     2015-04-24  1482  								+ ofs_in_node;
6dbb17961f46b2 Eric Biggers    2018-04-18  1483  			if (f2fs_post_read_required(inode))
48018b4cfd07dd Chao Yu         2018-09-13  1484  				err = move_data_block(inode, start_bidx,
48018b4cfd07dd Chao Yu         2018-09-13  1485  							gc_type, segno, off);
4375a33664de17 Jaegeuk Kim     2015-04-23  1486  			else
48018b4cfd07dd Chao Yu         2018-09-13  1487  				err = move_data_page(inode, start_bidx, gc_type,
d4c759ee5faa51 Jaegeuk Kim     2017-09-05  1488  								segno, off);
82e0a5aa5ddf79 Chao Yu         2016-07-13  1489  
48018b4cfd07dd Chao Yu         2018-09-13  1490  			if (!err && (gc_type == FG_GC ||
48018b4cfd07dd Chao Yu         2018-09-13  1491  					f2fs_post_read_required(inode)))
48018b4cfd07dd Chao Yu         2018-09-13  1492  				submitted++;
48018b4cfd07dd Chao Yu         2018-09-13  1493  
82e0a5aa5ddf79 Chao Yu         2016-07-13  1494  			if (locked) {
b2532c694033fb Chao Yu         2018-04-24  1495  				up_write(&fi->i_gc_rwsem[WRITE]);
b2532c694033fb Chao Yu         2018-04-24  1496  				up_write(&fi->i_gc_rwsem[READ]);
82e0a5aa5ddf79 Chao Yu         2016-07-13  1497  			}
82e0a5aa5ddf79 Chao Yu         2016-07-13  1498  
e1235983e385af Changman Lee    2014-12-23  1499  			stat_inc_data_blk_count(sbi, 1, gc_type);
7bc0900347e069 Jaegeuk Kim     2012-11-02  1500  		}
7bc0900347e069 Jaegeuk Kim     2012-11-02  1501  	}
c718379b6b0954 Jaegeuk Kim     2013-04-24  1502  
7ea984b0604ac3 Chao Yu         2016-08-27  1503  	if (++phase < 5)
7bc0900347e069 Jaegeuk Kim     2012-11-02  1504  		goto next_step;
48018b4cfd07dd Chao Yu         2018-09-13  1505  
48018b4cfd07dd Chao Yu         2018-09-13  1506  	return submitted;
7bc0900347e069 Jaegeuk Kim     2012-11-02  1507  }
7bc0900347e069 Jaegeuk Kim     2012-11-02  1508  

:::::: The code at line 1358 was first introduced by commit
:::::: 48018b4cfd07dd2df9a067fb3a6a3221c19eed11 f2fs: submit cached bio to avoid endless PageWriteback

:::::: TO: Chao Yu <yuchao0@...wei.com>
:::::: CC: Jaegeuk Kim <jaegeuk@...nel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (20874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ