summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-07-07 07:33:26 +0200
committerDavid Sterba <dsterba@suse.com>2022-07-25 17:45:43 +0200
commitc144c63fd33a1fc0e43e0b851a35b09c9460d94d (patch)
tree19dee35d4a5b607f6ed8d89462141d7b5c8c7545 /fs/btrfs/extent_io.h
parentd28beb3e8131b3cb322052410d8ad20c4a841c83 (diff)
downloadlinux-stable-c144c63fd33a1fc0e43e0b851a35b09c9460d94d.tar.gz
linux-stable-c144c63fd33a1fc0e43e0b851a35b09c9460d94d.tar.bz2
linux-stable-c144c63fd33a1fc0e43e0b851a35b09c9460d94d.zip
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>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index a76c6ef74cd3..280af70c0495 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -263,6 +263,7 @@ struct io_failure_record {
enum btrfs_compression_type compress_type;
int this_mirror;
int failed_mirror;
+ int num_copies;
};
int btrfs_repair_one_sector(struct inode *inode,