btrfs-progs/kernel-shared
Qu Wenruo 4e9e978783 btrfs-progs: allow read_data_from_disk() to rebuild RAID56 using P/Q
This new ability is added by:

- Allow btrfs_map_block() to return the chunk type
  This makes later work much easier

- Only reset stripe offset inside btrfs_map_block() when needed
  Currently if @raid_map is not NULL, btrfs_map_block() will consider
  this call is for WRITE and will reset stripe offset.

  This is no longer the case, as for RAID56 read with mirror_num 1/0,
  we will still call btrfs_map_block() with non-NULL raid_map.

  Add a small check to make sure we won't reset stripe offset for
  mirror 1/0 read.

- Add new helper read_raid56() to handle rebuild
  We will read the full stripe (including all data and P/Q stripes)
  do the rebuild, then only copy the refered part to the caller.

  There is a catch for RAID6, we have no way to exhaust all combination,
  so the current repair will assume the mirror = 0 data is corrupted,
  then try to find a missing device.

  But if no missing device can be found, it will assume P is corrupted.
  This is just a guess, and can to totally wrong, but we have no better
  idea.

Now btrfs-progs have full read ability for RAID56.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-04-25 19:08:30 +02:00
..
backref.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
backref.h
ctree.c btrfs-progs: remove extent_buffer::fd and extent_buffer::dev_bytes 2022-04-25 19:08:30 +02:00
ctree.h btrfs-progs: dump-tree: add print support for verity items 2022-03-24 00:49:19 +01:00
delayed-ref.c
delayed-ref.h
dir-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
disk-io.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
disk-io.h btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
extent_io.c btrfs-progs: allow read_data_from_disk() to rebuild RAID56 using P/Q 2022-04-25 19:08:30 +02:00
extent_io.h btrfs-progs: remove extent_buffer::fd and extent_buffer::dev_bytes 2022-04-25 19:08:30 +02:00
extent-tree.c btrfs-progs: handle the per-block group global root id 2022-03-09 18:07:17 +01:00
file-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
file.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
free-space-cache.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
free-space-cache.h
free-space-tree.c btrfs-progs: make btrfs_create_tree take a key for the root key 2022-03-09 18:07:22 +01:00
free-space-tree.h
inode-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
inode.c
print-tree.c btrfs-progs: dump-tree: add print support for verity items 2022-03-24 00:49:19 +01:00
print-tree.h
root-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
send.h
transaction.c btrfs-progs: fix a memory leak when starting a transaction on fs with error 2022-04-25 18:32:17 +02:00
transaction.h
ulist.c
ulist.h
uuid-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
volumes.c btrfs-progs: allow read_data_from_disk() to rebuild RAID56 using P/Q 2022-04-25 19:08:30 +02:00
volumes.h btrfs-progs: allow read_data_from_disk() to rebuild RAID56 using P/Q 2022-04-25 19:08:30 +02:00
zoned.c btrfs-progs: zoned: export sb_zone_number() and related constants 2022-04-08 23:17:35 +02:00
zoned.h btrfs-progs: zoned: export sb_zone_number() and related constants 2022-04-08 23:17:35 +02:00