]> 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)
commitfb6906312a856ea10e4b2dca07a974665fbe19e6
treee1f88a7d401224779bab91b9c82ca9723a1b564f
parentc1edfee7bd32474cf5f560635e0428f413d56153
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