]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Btrfs: fix scrub to repair raid6 corruption
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 15 Jun 2018 02:39:02 +0000 (02:39 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:57:23 +0000 (14:57 +0200)
commit42976286d601530f8df194d7d0ce3231bfbcce48
tree44ff2dffa7618d5d7d66147abb40f897c02d7687
parentac1445c17ac605291d3c23b841b456444276cb42
Btrfs: fix scrub to repair raid6 corruption

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit 762221f095e3932669093466aaf4b85ed9ad2ac1 ]

The raid6 corruption is that,
suppose that all disks can be read without problems and if the content
that was read out doesn't match its checksum, currently for raid6
btrfs at most retries twice,

- the 1st retry is to rebuild with all other stripes, it'll eventually
  be a raid5 xor rebuild,
- if the 1st fails, the 2nd retry will deliberately fail parity p so
  that it will do raid6 style rebuild,

however, the chances are that another non-parity stripe content also
has something corrupted, so that the above retries are not able to
return correct content.

We've fixed normal reads to rebuild raid6 correctly with more retries
in Patch "Btrfs: make raid6 rebuild retry more"[1], this is to fix
scrub to do the exactly same rebuild process.

[1]: https://patchwork.kernel.org/patch/10091755/

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/btrfs/scrub.c