btrfs-progs/cmds
Qu Wenruo 41ff76b833 btrfs-progs: restore: Do proper mirror iteration in copy_one_extent()
The old code of copy_one_extent() is a mess:
- The main loop is implemented using goto
- @mirror_num is reset to 1 for each loop
- @mirror num check against @num_copies is wrong for decompression error

This patch will fix this mess by:
- Use read_extent_data()
  read_extent_data() has all the good wrapping of btrfs_map_block()
  and length check.
  This removes a lot of complexity.

- Add extra file extent offset check
  To prevent underflow for memory allocation

- Do proper mirror_num check for decompression error

Issue: #221
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-31 18:37:35 +02:00
..
balance.c btrfs-progs: add support for raid1c3 and raid1c4 2019-11-22 19:09:50 +01:00
commands.h btrfs-progs: help: define helper for command with flags 2019-07-03 20:49:04 +02:00
device.c btrfs-progs: utils: split device scanning functions to own file 2019-07-04 02:06:34 +02:00
filesystem-du.c btrfs-progs: fix helpinfo formats, short and options separation 2019-07-03 20:49:04 +02:00
filesystem-usage.c btrfs-progs: fi usage: print ratio of used/total for each chunk type 2019-11-22 19:09:52 +01:00
filesystem-usage.h btrfs-progs: move all cmds-fi*.c to cmds/ 2019-07-03 20:49:03 +02:00
filesystem.c btrfs-progs: utils: split device scanning functions to own file 2019-07-04 02:06:34 +02:00
inspect-dump-super.c btrfs-progs: add support for raid1c3 and raid1c4 2019-11-22 19:09:50 +01:00
inspect-dump-tree.c btrfs-progs: dump-tree: rename to option to --hide-names 2020-03-20 22:05:27 +01:00
inspect-tree-stats.c btrfs-progs: fix helpinfo formats, short and options separation 2019-07-03 20:49:04 +02:00
inspect.c btrfs-progs: inspect: make sure LOGICAL_INO_V2 args are zero-initialized 2020-03-04 19:21:09 +01:00
property.c btrfs-progs: props: update help texts 2019-07-26 17:46:42 +02:00
qgroup.c btrfs-progs: qgroup: allow passing options to qgroup remove 2020-03-20 22:05:25 +01:00
quota.c btrfs-progs: move utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
receive.c btrfs-progs: receive: make option quiet work 2019-11-18 19:21:08 +01:00
replace.c btrfs-progs: utils: split device handling functions to own file 2019-07-04 02:06:34 +02:00
rescue-chunk-recover.c btrfs-progs: reform block groups caches structure 2020-03-03 19:58:54 +01:00
rescue-super-recover.c btrfs-progs: move crc32c implementation to crypto/ 2019-11-18 19:20:02 +01:00
rescue.c btrfs-progs: rescue/zero-log: Manually write all supers to handle extent tree error more gracefully 2019-11-22 19:07:21 +01:00
rescue.h btrfs-progs: move cmds-rescue.c to cmds/ 2019-07-03 20:49:02 +02:00
restore.c btrfs-progs: restore: Do proper mirror iteration in copy_one_extent() 2020-03-31 18:37:35 +02:00
scrub.c btrfs-progs: scrub: fix status lines alignment 2019-07-26 17:46:43 +02:00
send.c btrfs-progs: utils: split path related utils to own file 2019-07-04 02:06:31 +02:00
subvolume.c btrfs-progs: subvol delete: add --subvolid argument to deletee by id 2020-03-04 19:21:09 +01:00