From: Christoph Hellwig <hch@infradead.org>
To: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: misc-next and for-next: kernel BUG at fs/btrfs/extent_io.c:2350! during raid5 recovery
Date: Tue, 9 Aug 2022 01:29:59 -0700 [thread overview]
Message-ID: <YvIbB5l4gtG4f/S9@infradead.org> (raw)
In-Reply-To: <YvHVJ8t5vzxH9fS9@hungrycats.org>
On Mon, Aug 08, 2022 at 11:31:51PM -0400, Zygo Blaxell wrote:
> There is now a BUG_ON arising from this test case:
>
> [ 241.051326][ T45] btrfs_print_data_csum_error: 156 callbacks suppressed
> [ 241.100910][ T45] ------------[ cut here ]------------
> [ 241.102531][ T45] kernel BUG at fs/btrfs/extent_io.c:2350!
This
BUG_ON(!mirror_num);
so repair_io_failure gets called with a mirror_num of 0..
> [ 241.128354][ T45] clean_io_failure+0x21a/0x260
.. from clean_io_failure. Which starts from failrec->this_mirror and
tries to go back to failrec->failed_mirror using the prev_mirror
helper. prev_mirror looks like:
static int prev_mirror(const struct io_failure_record *failrec, int cur_mirror)
{
if (cur_mirror == 1)
return failrec->num_copies;
return cur_mirror - 1;
}
So the only way we could end up with a mirror = 0 is if
failrec->num_copies is 0. -failrec->num_copies is initialized
in btrfs_get_io_failure_record by doing:
failrec->num_copies = btrfs_num_copies(fs_info, failrec->logical, sectorsize);
just adter allocating the failrec. I can't see any obvious way how
btrfs_num_copies would return 0, though, as for raid5 it just copies
from btrfs_raid_array.
Any chance you could share a script for your reproducer?
next prev parent reply other threads:[~2022-08-09 8:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 3:31 misc-next and for-next: kernel BUG at fs/btrfs/extent_io.c:2350! during raid5 recovery Zygo Blaxell
2022-08-09 4:36 ` Qu Wenruo
2022-08-09 19:46 ` Zygo Blaxell
2022-08-10 7:17 ` Qu Wenruo
2022-08-14 4:52 ` Qu Wenruo
2022-08-16 1:01 ` Zygo Blaxell
2022-08-16 1:25 ` Qu Wenruo
2022-08-09 7:35 ` Qu Wenruo
2022-08-09 19:29 ` Zygo Blaxell
2022-08-09 21:50 ` Qu Wenruo
2022-08-10 8:08 ` Goffredo Baroncelli
2022-08-10 8:24 ` Qu Wenruo
2022-08-10 8:45 ` Goffredo Baroncelli
2022-08-10 9:14 ` Qu Wenruo
2022-08-09 8:29 ` Christoph Hellwig [this message]
2022-08-09 19:24 ` Zygo Blaxell
2022-08-12 2:58 ` Wang Yugui
2022-08-12 22:47 ` Wang Yugui
2022-08-13 1:50 ` 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=YvIbB5l4gtG4f/S9@infradead.org \
--to=hch@infradead.org \
--cc=ce3g8jdj@umail.furryterror.org \
--cc=linux-btrfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox