[chao-linux:feature/dax 3/9] fs/f2fs/gc.c:1629:9: error: void value not ignored as it ought to be

From: kernel test robot
Date: Sun Aug 08 2021 - 13:35:56 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git feature/dax
head: fe9932d5af4ceade2736e4a3a8c245e05331c392
commit: 3439077550d3f6366feeb4f09da20162e3a4c86c [3/9] f2fs: support migrate page in dax device
config: riscv-randconfig-r015-20210808 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 10.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=3439077550d3f6366feeb4f09da20162e3a4c86c
git remote add chao-linux https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git
git fetch --no-tags chao-linux feature/dax
git checkout 3439077550d3f6366feeb4f09da20162e3a4c86c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash fs/f2fs/

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

All errors (new ones prefixed by >>):

fs/f2fs/gc.c: In function 'gc_data_segment':
>> fs/f2fs/gc.c:1629:9: error: void value not ignored as it ought to be
1629 | err = dax_move_data_page(inode, start_bidx,
| ^


vim +1629 fs/f2fs/gc.c

1491
1492 /*
1493 * This function tries to get parent node of victim data block, and identifies
1494 * data block validity. If the block is valid, copy that with cold status and
1495 * modify parent node.
1496 * If the parent node is not valid or the data block address is different,
1497 * the victim data block is ignored.
1498 */
1499 static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
1500 struct gc_inode_list *gc_list, unsigned int segno, int gc_type,
1501 bool force_migrate)
1502 {
1503 struct super_block *sb = sbi->sb;
1504 struct f2fs_summary *entry;
1505 block_t start_addr;
1506 int off;
1507 int phase = 0;
1508 int submitted = 0;
1509 unsigned int usable_blks_in_seg = f2fs_usable_blks_in_seg(sbi, segno);
1510
1511 start_addr = START_BLOCK(sbi, segno);
1512
1513 next_step:
1514 entry = sum;
1515
1516 for (off = 0; off < usable_blks_in_seg; off++, entry++) {
1517 struct page *data_page;
1518 struct inode *inode;
1519 struct node_info dni; /* dnode info for the data */
1520 unsigned int ofs_in_node, nofs;
1521 block_t start_bidx;
1522 nid_t nid = le32_to_cpu(entry->nid);
1523
1524 /*
1525 * stop BG_GC if there is not enough free sections.
1526 * Or, stop GC if the segment becomes fully valid caused by
1527 * race condition along with SSR block allocation.
1528 */
1529 if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
1530 (!force_migrate && get_valid_blocks(sbi, segno, true) ==
1531 BLKS_PER_SEC(sbi)))
1532 return submitted;
1533
1534 if (check_valid_map(sbi, segno, off) == 0)
1535 continue;
1536
1537 if (phase == 0) {
1538 f2fs_ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nid), 1,
1539 META_NAT, true);
1540 continue;
1541 }
1542
1543 if (phase == 1) {
1544 f2fs_ra_node_page(sbi, nid);
1545 continue;
1546 }
1547
1548 /* Get an inode by ino with checking validity */
1549 if (!is_alive(sbi, entry, &dni, start_addr + off, &nofs))
1550 continue;
1551
1552 if (phase == 2) {
1553 f2fs_ra_node_page(sbi, dni.ino);
1554 continue;
1555 }
1556
1557 ofs_in_node = le16_to_cpu(entry->ofs_in_node);
1558
1559 if (phase == 3) {
1560 inode = f2fs_iget(sb, dni.ino);
1561 if (IS_ERR(inode) || is_bad_inode(inode))
1562 continue;
1563
1564 if (IS_DAX(inode)) {
1565 add_gc_inode(gc_list, inode);
1566 continue;
1567 }
1568
1569 if (!down_write_trylock(
1570 &F2FS_I(inode)->i_gc_rwsem[WRITE])) {
1571 iput(inode);
1572 sbi->skipped_gc_rwsem++;
1573 continue;
1574 }
1575
1576 start_bidx = f2fs_start_bidx_of_node(nofs, inode) +
1577 ofs_in_node;
1578
1579 if (f2fs_post_read_required(inode)) {
1580 int err = ra_data_block(inode, start_bidx);
1581
1582 up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
1583 if (err) {
1584 iput(inode);
1585 continue;
1586 }
1587 add_gc_inode(gc_list, inode);
1588 continue;
1589 }
1590
1591 data_page = f2fs_get_read_data_page(inode,
1592 start_bidx, REQ_RAHEAD, true);
1593 up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
1594 if (IS_ERR(data_page)) {
1595 iput(inode);
1596 continue;
1597 }
1598
1599 f2fs_put_page(data_page, 0);
1600 add_gc_inode(gc_list, inode);
1601 continue;
1602 }
1603
1604 /* phase 4 */
1605 inode = find_gc_inode(gc_list, dni.ino);
1606 if (inode) {
1607 struct f2fs_inode_info *fi = F2FS_I(inode);
1608 bool locked = false;
1609 int err;
1610
1611 if (S_ISREG(inode->i_mode)) {
1612 if (!down_write_trylock(&fi->i_gc_rwsem[READ]))
1613 continue;
1614 if (!down_write_trylock(
1615 &fi->i_gc_rwsem[WRITE])) {
1616 sbi->skipped_gc_rwsem++;
1617 up_write(&fi->i_gc_rwsem[READ]);
1618 continue;
1619 }
1620 locked = true;
1621
1622 /* wait for all inflight aio data */
1623 inode_dio_wait(inode);
1624 }
1625
1626 start_bidx = f2fs_start_bidx_of_node(nofs, inode)
1627 + ofs_in_node;
1628 if (IS_DAX(inode))
> 1629 err = dax_move_data_page(inode, start_bidx,
1630 gc_type, segno, off);
1631 else if (f2fs_post_read_required(inode))
1632 err = move_data_block(inode, start_bidx,
1633 gc_type, segno, off);
1634 else
1635 err = move_data_page(inode, start_bidx, gc_type,
1636 segno, off);
1637
1638 if (!err && (gc_type == FG_GC ||
1639 f2fs_post_read_required(inode)))
1640 submitted++;
1641
1642 if (locked) {
1643 up_write(&fi->i_gc_rwsem[WRITE]);
1644 up_write(&fi->i_gc_rwsem[READ]);
1645 }
1646
1647 stat_inc_data_blk_count(sbi, 1, gc_type);
1648 }
1649 }
1650
1651 if (++phase < 5)
1652 goto next_step;
1653
1654 return submitted;
1655 }
1656

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

Attachment: .config.gz
Description: application/gzip