Btrfs: dev-replace: make sure target is identical to source when raid56 rebuild fails
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 2 Mar 2018 23:10:41 +0000 (16:10 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:43 +0000 (15:09 +0200)
commit4759700a71ab109c67376360e9f00e2fed6b3807
tree206e7dcaba8efee859c5c87ca952b7ee10fdbb1d
parentd6a691350b5d5381fad04a6dbf31bb6f393089b5
Btrfs: dev-replace: make sure target is identical to source when raid56 rebuild fails

In the last step of scrub_handle_error_block, we try to combine good
copies on all possible mirrors, this works fine for raid1 and raid10,
but not for raid56 as it's doing parity rebuild.

If parity rebuild doesn't get back with correct data which matches its
checksum, in case of replace we'd rather write what is stored in the
source device than the data calculuated from parity.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c