Hi Qu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.9-rc5]
[also build test ERROR on next-20200915]
[cannot apply to kdave/for-next btrfs/next]
[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]
url:
https://github.com/0day-ci/linux/commits/Qu-Wenruo/btrfs-add-read-only-su...
base: 856deb866d16e29bd65952e0289066f6078af773
config: m68k-randconfig-r014-20200913 (attached as .config)
compiler: m68k-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
m68k-linux-ld: fs/btrfs/disk-io.o: in function `btree_read_subpage_endio_hook':
> fs/btrfs/disk-io.c:674: undefined reference to `__udivdi3'
m68k-linux-ld: fs/btrfs/extent_io.o: in function `release_extent_buffer':
fs/btrfs/extent_io.c:5480: undefined reference to `__udivdi3'
m68k-linux-ld: fs/btrfs/extent_io.o: in function `find_extent_buffer':
fs/btrfs/extent_io.c:5230: undefined reference to `__udivdi3'
m68k-linux-ld: fs/btrfs/extent_io.o: in function `alloc_extent_buffer':
fs/btrfs/extent_io.c:5411: undefined reference to `__udivdi3'
#
https://github.com/0day-ci/linux/commit/1cc0af35d8945ec5e3a36ca3f0d51c1c7...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Qu-Wenruo/btrfs-add-read-only-support-for-subpage-sector-size/20200915-133811
git checkout 1cc0af35d8945ec5e3a36ca3f0d51c1c70a37e1a
vim +674 fs/btrfs/disk-io.c
647
648 static int btree_read_subpage_endio_hook(struct page *page, u64 start, u64 end,
649 int mirror)
650 {
651 struct btrfs_fs_info *fs_info = page_to_fs_info(page);
652 struct extent_io_tree *io_tree = info_to_btree_io_tree(fs_info);
653 struct extent_buffer *eb;
654 int reads_done;
655 int ret = 0;
656
657 if (!IS_ALIGNED(start, fs_info->sectorsize) ||
658 !IS_ALIGNED(end - start + 1, fs_info->sectorsize) ||
659 !IS_ALIGNED(end - start + 1, fs_info->nodesize)) {
660 WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
661 btrfs_err(fs_info, "invalid tree read bytenr");
662 return -EUCLEAN;
663 }
664
665 /*
666 * We don't allow bio merge for subpage metadata read, so we should
667 * only get one eb for each endio hook.
668 */
669 ASSERT(end == start + fs_info->nodesize - 1);
670 ASSERT(PagePrivate(page));
671
672 rcu_read_lock();
673 eb = radix_tree_lookup(&fs_info->buffer_radix,
674 start / fs_info->sectorsize);
675 rcu_read_unlock();
676
677 /*
678 * When we are reading one tree block, eb must have been
679 * inserted into the radix tree. If not something is wrong.
680 */
681 if (!eb) {
682 WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
683 btrfs_err(fs_info,
684 "can't find extent buffer for bytenr %llu",
685 start);
686 return -EUCLEAN;
687 }
688 /*
689 * The pending IO might have been the only thing that kept
690 * this buffer in memory. Make sure we have a ref for all
691 * this other checks
692 */
693 atomic_inc(&eb->refs);
694
695 reads_done = atomic_dec_and_test(&eb->io_pages);
696 /* Subpage read must finish in page read */
697 ASSERT(reads_done);
698
699 eb->read_mirror= mirror;
700 if (test_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags)) {
701 ret = -EIO;
702 goto err;
703 }
704 ret = btrfs_check_extent_buffer(eb);
705 if (ret < 0)
706 goto err;
707
708 if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
709 btree_readahead_hook(eb, ret);
710
711 set_extent_buffer_uptodate(eb);
712
713 free_extent_buffer(eb);
714
715 /*
716 * Since we don't use PageLocked() but extent_io_tree lock to lock the
717 * range, we need to unlock the range here.
718 */
719 unlock_extent(io_tree, start, end);
720 return ret;
721 err:
722 /*
723 * our io error hook is going to dec the io pages
724 * again, we have to make sure it has something to
725 * decrement
726 */
727 atomic_inc(&eb->io_pages);
728 clear_extent_buffer_uptodate(eb);
729 free_extent_buffer(eb);
730 unlock_extent(io_tree, start, end);
731 return ret;
732 }
733
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org