]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: repair all known bad mirrors
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Jul 2022 05:33:26 +0000 (07:33 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:43 +0000 (17:45 +0200)
commitddcab8d2cf9ae65b42ce6808e4d163a92e73ca76
tree19dee35d4a5b607f6ed8d89462141d7b5c8c7545
parent8085b085d1411ba768f2664dd312b14360c4f030
btrfs: repair all known bad mirrors

When there is more than a single level of redundancy there can also be
multiple bad mirrors, and the current read repair code only repairs the
last bad one.

Restructure btrfs_repair_one_sector so that it records the originally
failed mirror and the number of copies, and then repair all known bad
copies until we reach the originally failed copy in clean_io_failure.
Note that this also means the read repair reads will always start from
the next bad mirror and not mirror 0.

This fixes btrfs/265 in xfstests.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h