]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: enable repair during read for raid56 profile
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 29 Mar 2017 17:53:58 +0000 (10:53 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Apr 2017 12:07:26 +0000 (14:07 +0200)
commitd1af3002abc4705a3015076795230b7d16786af4
treee1f88a7d401224779bab91b9c82ca9723a1b564f
parent972051ce2361f6a0e5d8d5f86f3ab428798ee827
Btrfs: enable repair during read for raid56 profile

Now that scrub can fix data errors with the help of parity for raid56
profile, repair during read is able to as well.

Although the mirror num in raid56 scenario has different meanings, i.e.
0 or 1: read data directly
> 1:    do recover with parity,
it could be fit into how we repair bad block during read.

The trick is to use BTRFS_MAP_READ instead of BTRFS_MAP_WRITE to get the
device and position on it.

Cc: David Sterba <dsterba@suse.cz>
Tested-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c