All of lore.kernel.org
 help / color / mirror / Atom feed
* [chao-linux:simple_copy 5/5] fs/f2fs/node.c:1526:6: warning: variable 'ret' set but not used
@ 2021-02-10  6:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-10  6:32 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5284 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git simple_copy
head:   d6f32b90156624ae9dc06ef5873334a48e9b9806
commit: d6f32b90156624ae9dc06ef5873334a48e9b9806 [5/5] f2fs: use BLK_COPY ioctl for gc.
config: xtensa-randconfig-r004-20210209 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
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://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?id=d6f32b90156624ae9dc06ef5873334a48e9b9806
        git remote add chao-linux https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git
        git fetch --no-tags chao-linux simple_copy
        git checkout d6f32b90156624ae9dc06ef5873334a48e9b9806
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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

All warnings (new ones prefixed by >>):

   fs/f2fs/node.c: In function '__write_node_page':
>> fs/f2fs/node.c:1526:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
    1526 |  int ret = 0;
         |      ^~~


vim +/ret +1526 fs/f2fs/node.c

  1505	
  1506	static int __write_node_page(struct page *page, bool atomic, bool *submitted,
  1507					struct writeback_control *wbc, bool do_balance,
  1508					enum iostat_type io_type, unsigned int *seq_id, int do_copy)
  1509	{
  1510		struct f2fs_sb_info *sbi = F2FS_P_SB(page);
  1511		nid_t nid;
  1512		struct node_info ni;
  1513		struct f2fs_io_info fio = {
  1514			.sbi = sbi,
  1515			.ino = ino_of_node(page),
  1516			.type = NODE,
  1517			.op = REQ_OP_WRITE,
  1518			.op_flags = wbc_to_write_flags(wbc),
  1519			.page = page,
  1520			.encrypted_page = NULL,
  1521			.submitted = false,
  1522			.io_type = io_type,
  1523			.io_wbc = wbc,
  1524		};
  1525		unsigned int seq;
> 1526		int ret = 0;
  1527	
  1528		trace_f2fs_writepage(page, NODE);
  1529	
  1530		if (unlikely(f2fs_cp_error(sbi))) {
  1531			if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) {
  1532				ClearPageUptodate(page);
  1533				dec_page_count(sbi, F2FS_DIRTY_NODES);
  1534				unlock_page(page);
  1535				return 0;
  1536			}
  1537			goto redirty_out;
  1538		}
  1539	
  1540		if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
  1541			goto redirty_out;
  1542	
  1543		if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
  1544				wbc->sync_mode == WB_SYNC_NONE &&
  1545				IS_DNODE(page) && is_cold_node(page))
  1546			goto redirty_out;
  1547	
  1548		/* get old block addr of this node page */
  1549		nid = nid_of_node(page);
  1550		f2fs_bug_on(sbi, page->index != nid);
  1551	
  1552		if (f2fs_get_node_info(sbi, nid, &ni))
  1553			goto redirty_out;
  1554	
  1555		if (wbc->for_reclaim) {
  1556			if (!down_read_trylock(&sbi->node_write))
  1557				goto redirty_out;
  1558		} else {
  1559			down_read(&sbi->node_write);
  1560		}
  1561	
  1562		/* This page is already truncated */
  1563		if (unlikely(ni.blk_addr == NULL_ADDR)) {
  1564			ClearPageUptodate(page);
  1565			dec_page_count(sbi, F2FS_DIRTY_NODES);
  1566			up_read(&sbi->node_write);
  1567			unlock_page(page);
  1568			return 0;
  1569		}
  1570	
  1571		if (__is_valid_data_blkaddr(ni.blk_addr) &&
  1572			!f2fs_is_valid_blkaddr(sbi, ni.blk_addr,
  1573						DATA_GENERIC_ENHANCE)) {
  1574			up_read(&sbi->node_write);
  1575			goto redirty_out;
  1576		}
  1577	
  1578		if (atomic && !test_opt(sbi, NOBARRIER))
  1579			fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
  1580	
  1581		/* should add to global list before clearing PAGECACHE status */
  1582		if (f2fs_in_warm_node_list(sbi, page)) {
  1583			seq = f2fs_add_fsync_node_entry(sbi, page);
  1584			if (seq_id)
  1585				*seq_id = seq;
  1586		}
  1587	
  1588		set_page_writeback(page);
  1589		ClearPageError(page);
  1590	
  1591		fio.old_blkaddr = ni.blk_addr;
  1592		ret = f2fs_do_write_node_page(nid, &fio, do_copy);
  1593		set_node_addr(sbi, &ni, fio.new_blkaddr, is_fsync_dnode(page));
  1594		dec_page_count(sbi, F2FS_DIRTY_NODES);
  1595		up_read(&sbi->node_write);
  1596	
  1597		if (wbc->for_reclaim) {
  1598			f2fs_submit_merged_write_cond(sbi, NULL, page, 0, NODE);
  1599			submitted = NULL;
  1600		}
  1601	
  1602		unlock_page(page);
  1603	
  1604		if (unlikely(f2fs_cp_error(sbi))) {
  1605			f2fs_submit_merged_write(sbi, NODE);
  1606			submitted = NULL;
  1607		}
  1608		if (submitted)
  1609			*submitted = fio.submitted;
  1610	
  1611		if (do_copy) {
  1612			if (f2fs_in_warm_node_list(sbi, page))
  1613				f2fs_del_fsync_node_entry(sbi, page);
  1614			clear_cold_data(page);
  1615		}
  1616	
  1617		if (do_balance)
  1618			f2fs_balance_fs(sbi, false);
  1619		return 0;
  1620	
  1621	redirty_out:
  1622		redirty_page_for_writepage(wbc, page);
  1623		return AOP_WRITEPAGE_ACTIVATE;
  1624	}
  1625	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30662 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-10  6:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  6:32 [chao-linux:simple_copy 5/5] fs/f2fs/node.c:1526:6: warning: variable 'ret' set but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.