Re: [PATCH v2] f2fs: checkpoint disabling
From: kbuild test robot
Date: Fri Jul 27 2018 - 19:23:04 EST
Hi Daniel,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on f2fs/dev-test]
[cannot apply to v4.18-rc6 next-20180727]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniel-Rosenberg/f2fs-checkpoint-disabling/20180728-035921
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
config: i386-randconfig-x0-07280409 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
fs/f2fs/data.o: In function `inc_valid_block_count':
>> fs/f2fs/f2fs.h:1717: undefined reference to `__umoddi3'
vim +1717 fs/f2fs/f2fs.h
1657
1658 static inline void f2fs_i_blocks_write(struct inode *, block_t, bool, bool);
1659 static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
1660 struct inode *inode, blkcnt_t *count)
1661 {
1662 blkcnt_t diff = 0, release = 0, seg_diff = 0, seg_rel = 0;
1663 block_t avail_user_block_count;
1664 int ret;
1665
1666 ret = dquot_reserve_block(inode, *count);
1667 if (ret)
1668 return ret;
1669
1670 #ifdef CONFIG_F2FS_FAULT_INJECTION
1671 if (time_to_inject(sbi, FAULT_BLOCK)) {
1672 f2fs_show_injection_info(FAULT_BLOCK);
1673 release = *count;
1674 goto enospc;
1675 }
1676 #endif
1677 /*
1678 * let's increase this in prior to actual block count change in order
1679 * for f2fs_sync_file to avoid data races when deciding checkpoint.
1680 */
1681 percpu_counter_add(&sbi->alloc_valid_block_count, (*count));
1682
1683 spin_lock(&sbi->stat_lock);
1684 sbi->total_valid_block_count += (block_t)(*count);
1685 avail_user_block_count = sbi->user_block_count -
1686 sbi->current_reserved_blocks;
1687
1688 if (!__allow_reserved_blocks(sbi, inode, true))
1689 avail_user_block_count -= F2FS_OPTION(sbi).root_reserved_blocks;
1690 if (test_opt(sbi, DISABLE_CHECKPOINT))
1691 avail_user_block_count -= sbi->unusable_block_count;
1692
1693 if (unlikely(sbi->total_valid_block_count > avail_user_block_count)) {
1694 diff = sbi->total_valid_block_count - avail_user_block_count;
1695 if (diff > *count)
1696 diff = *count;
1697 *count -= diff;
1698 release = diff;
1699 sbi->total_valid_block_count -= diff;
1700 if (!*count) {
1701 spin_unlock(&sbi->stat_lock);
1702 goto enospc;
1703 }
1704 }
1705 if (likely(!test_opt(sbi, DISABLE_CHECKPOINT)))
1706 goto normal;
1707 if (unlikely(*count > sbi->free_ssr_data_block)) {
1708 /* We'll need to pull from free. */
1709 blkcnt_t needed = *count - sbi->free_ssr_data_block;
1710 blkcnt_t new_segs = ((needed - 1) >>
1711 sbi->log_blocks_per_seg) + 1;
1712
1713 /* Check if we have enough free */
1714 if (unlikely(new_segs > sbi->free_segments)) {
1715 seg_diff = new_segs - sbi->free_segments;
1716
> 1717 seg_rel = ((needed - 1) % sbi->log_blocks_per_seg) + 1;
1718 seg_rel += (seg_diff - 1) << sbi->log_blocks_per_seg;
1719 new_segs -= seg_diff;
1720 *count -= seg_rel;
1721 release += seg_rel;
1722 if (!*count) {
1723 spin_unlock(&sbi->stat_lock);
1724 goto enospc;
1725 }
1726 }
1727
1728 sbi->free_segments -= new_segs;
1729 sbi->free_ssr_data_block += new_segs << sbi->log_blocks_per_seg;
1730
1731 }
1732 sbi->free_ssr_data_block -= *count;
1733 normal:
1734 spin_unlock(&sbi->stat_lock);
1735
1736 if (unlikely(release)) {
1737 percpu_counter_sub(&sbi->alloc_valid_block_count, release);
1738 dquot_release_reservation_block(inode, release);
1739 }
1740 f2fs_i_blocks_write(inode, *count, true, true);
1741 return 0;
1742
1743 enospc:
1744 percpu_counter_sub(&sbi->alloc_valid_block_count, release);
1745 dquot_release_reservation_block(inode, release);
1746 return -ENOSPC;
1747 }
1748
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip