btrfs: do not try to repair bio that has no mirror set
authorJosef Bacik <josef@toxicpanda.com>
Thu, 10 Feb 2022 22:44:25 +0000 (17:44 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 15 Feb 2022 15:55:32 +0000 (16:55 +0100)
commit5ba2cd2be13775d25e163753afcc1fc97b11ffff
tree58cab3c9606b93e43f48b25f2fd5a481dc35991f
parentf9598dce2aba69d6bd8fbebbbf9b3aa538a24d5e
btrfs: do not try to repair bio that has no mirror set

If we fail to submit a bio for whatever reason, we may not have setup a
mirror_num for that bio.  This means we shouldn't try to do the repair
workflow, if we do we'll hit an BUG_ON(!failrec->this_mirror) in
clean_io_failure.  Instead simply skip the repair workflow if we have no
mirror set, and add an assert to btrfs_check_repairable() to make it
easier to catch what is happening in the future.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c