btrfs-progs/kernel-lib
Qu Wenruo 2755204480 btrfs-progs: raid56: fix the wrong recovery condition for data and P case
There is a bug in raid56_recov() which doesn't properly repair data and
P case corruption:

	/* Data and P*/
	if (dest2 == nr_devs - 1)
		return raid6_recov_datap(nr_devs, stripe_len, dest1, data);

Note that, dest1/2 is to indicate which slot has corruption.

For RAID6 cases:

[0, nr_devs - 2) is for data stripes,
@data_devs - 2 is for P,
@data_devs - 1 is for Q.

For above code, the comment is correct, but the check condition is
wrong, and leads to the only project, btrfs-fuse, to report raid6
recovery error for 2 devices missing case.

Fix it by using correct condition.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-11-18 10:17:33 +01:00
..
bitops.h btrfs-progs: remove unnecessary linux/*.h includes 2021-05-06 16:41:47 +02:00
interval_tree_generic.h btrfs-progs: build: drop kernel-lib from -I and update paths 2019-07-03 20:49:04 +02:00
list_sort.c btrfs-progs: build: drop kernel-lib from -I and update paths 2019-07-03 20:49:04 +02:00
list_sort.h
list.h
mktables.c btrfs-progs: raid56: Introduce tables for RAID6 recovery 2017-07-03 13:35:11 +02:00
overflow.h btrfs-progs: kernel-lib: add overflow check helpers 2019-09-04 16:08:22 +02:00
radix-tree.c btrfs-progs: a bunch of typo fixes 2021-01-13 22:33:10 +01:00
radix-tree.h btrfs-progs: libbtrfs: remove unneeded BTRFS_FLAT_INCLUDES protections 2021-10-08 20:47:03 +02:00
raid56.c btrfs-progs: raid56: fix the wrong recovery condition for data and P case 2021-11-18 10:17:33 +01:00
raid56.h btrfs-progs: Introduce wrapper to recover raid56 data 2017-07-03 13:35:11 +02:00
rbtree_augmented.h btrfs-progs: remove c++ protection from internal headers 2021-10-08 20:47:04 +02:00
rbtree.c btrfs-progs: build: drop kernel-lib from -I and update paths 2019-07-03 20:49:04 +02:00
rbtree.h btrfs-progs: fix typos in comments 2018-11-26 18:24:48 +01:00
sizes.h btrfs-progs: Introduce kernel sizes to cleanup large intermediate number 2017-03-08 13:00:45 +01:00
tables.c btrfs-progs: kernel-lib: add generated tables.c 2017-08-24 19:06:31 +02:00