btrfs: do not try to repair bio that has no mirror set
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Feb 2022 15:03:28 +0000 (10:03 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 15:20:04 +0000 (16:20 +0100)
commit55d05ca24020ff46c88733e51f999bf5add266e2
treecf26fd10668acc381b0c3161246fa91bf90f80c0
parent4a39c8c0ec7790f3e52ce4af869bef931443687c
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.

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c