From: kernel test robot <lkp@intel.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases without large folios
Date: Fri, 3 Oct 2025 00:46:37 +0800 [thread overview]
Message-ID: <202510030041.mTtTa2Pr-lkp@intel.com> (raw)
In-Reply-To: <33c39907866c148a360ff60387097fbad63a19aa.1759311101.git.wqu@suse.com>
Hi Qu,
kernel test robot noticed the following build errors:
[auto build test ERROR on kdave/for-next]
[also build test ERROR on linus/master next-20250929]
[cannot apply to v6.17]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Qu-Wenruo/btrfs-make-btrfs_csum_one_bio-handle-bs-ps-without-large-folios/20251001-175128
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
patch link: https://lore.kernel.org/r/33c39907866c148a360ff60387097fbad63a19aa.1759311101.git.wqu%40suse.com
patch subject: [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases without large folios
config: i386-randconfig-011-20251002 (https://download.01.org/0day-ci/archive/20251003/202510030041.mTtTa2Pr-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251003/202510030041.mTtTa2Pr-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510030041.mTtTa2Pr-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: fs/btrfs/bio.o: in function `btrfs_repair_io_failure':
>> fs/btrfs/bio.c:859:(.text+0x188c): undefined reference to `__udivdi3'
vim +859 fs/btrfs/bio.c
836
837 /*
838 * Submit a repair write.
839 *
840 * This bypasses btrfs_submit_bbio() deliberately, as that writes all copies in a
841 * RAID setup. Here we only want to write the one bad copy, so we do the
842 * mapping ourselves and submit the bio directly.
843 *
844 * The I/O is issued synchronously to block the repair read completion from
845 * freeing the bio.
846 *
847 * @ino: Offending inode number
848 * @fileoff: File offset inside the inode
849 * @length: Length of the repair write
850 * @logical: Logical address of the range
851 * @paddrs: Physical address array of the content.
852 * Length for each paddr should be min(sectorsize, PAGE_SIZE).
853 * @mirror_num: Mirror number to write to. Must not be zero.
854 */
855 int btrfs_repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 fileoff,
856 u64 length, u64 logical, const phys_addr_t paddrs[], int mirror_num)
857 {
858 const u32 step = min(fs_info->sectorsize, PAGE_SIZE);
> 859 const u32 nr_steps = DIV_ROUND_UP_POW2(length, step);
860 struct btrfs_io_stripe smap = { 0 };
861 struct bio *bio = NULL;
862 int ret = 0;
863
864 ASSERT(!(fs_info->sb->s_flags & SB_RDONLY));
865 BUG_ON(!mirror_num);
866
867 /* Basic alignment checks. */
868 ASSERT(IS_ALIGNED(logical, fs_info->sectorsize));
869 ASSERT(IS_ALIGNED(length, fs_info->sectorsize));
870 ASSERT(IS_ALIGNED(fileoff, fs_info->sectorsize));
871
872 if (btrfs_repair_one_zone(fs_info, logical))
873 return 0;
874
875 /*
876 * Avoid races with device replace and make sure our bioc has devices
877 * associated to its stripes that don't go away while we are doing the
878 * read repair operation.
879 */
880 btrfs_bio_counter_inc_blocked(fs_info);
881 ret = btrfs_map_repair_block(fs_info, &smap, logical, length, mirror_num);
882 if (ret < 0)
883 goto out_counter_dec;
884
885 if (unlikely(!smap.dev->bdev ||
886 !test_bit(BTRFS_DEV_STATE_WRITEABLE, &smap.dev->dev_state))) {
887 ret = -EIO;
888 goto out_counter_dec;
889 }
890
891 bio = bio_alloc(smap.dev->bdev, nr_steps, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS);
892 /* Backed by fs_bio_set, shouldn't fail. */
893 ASSERT(bio);
894 bio->bi_iter.bi_sector = smap.physical >> SECTOR_SHIFT;
895 for (int i = 0; i < nr_steps; i++) {
896 ret = bio_add_page(bio, phys_to_page(paddrs[i]), step, offset_in_page(paddrs[i]));
897 /* We should have allocated enough slots to contain all the different pages. */
898 ASSERT(ret == step);
899 }
900 ret = submit_bio_wait(bio);
901 if (ret) {
902 /* try to remap that extent elsewhere? */
903 btrfs_dev_stat_inc_and_print(smap.dev, BTRFS_DEV_STAT_WRITE_ERRS);
904 goto out_free_bio;
905 }
906
907 btrfs_info_rl(fs_info,
908 "read error corrected: ino %llu off %llu (dev %s sector %llu)",
909 ino, fileoff, btrfs_dev_name(smap.dev),
910 smap.physical >> SECTOR_SHIFT);
911 ret = 0;
912
913 out_free_bio:
914 if (bio)
915 bio_put(bio);
916 out_counter_dec:
917 btrfs_bio_counter_dec(fs_info);
918 return ret;
919 }
920
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-10-02 16:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 9:50 [PATCH 0/4] btrfs: enable encoded read/write/send for bs > ps cases Qu Wenruo
2025-10-01 9:50 ` [PATCH 1/4] btrfs: make btrfs_csum_one_bio() handle bs > ps without large folios Qu Wenruo
2025-10-01 9:50 ` [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases " Qu Wenruo
2025-10-02 16:46 ` kernel test robot [this message]
2025-10-01 9:50 ` [PATCH 3/4] btrfs: make read verification " Qu Wenruo
2025-10-01 9:50 ` [PATCH 4/4] btrfs: enable encoded read/write/send for bs > ps cases Qu Wenruo
-- strict thread matches above, loose matches on Subject: below --
2025-10-02 22:16 [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases without large folios kernel test robot
2025-10-03 7:58 ` Dan Carpenter
2025-10-03 9:17 ` Qu Wenruo
2025-10-03 10:53 ` Dan Carpenter
2025-10-03 21:18 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202510030041.mTtTa2Pr-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.