diff options
author | Omar Sandoval <osandov@fb.com> | 2015-06-19 18:52:52 (GMT) |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-08-09 14:34:26 (GMT) |
commit | 4a770891d9ddf94df985ca438e78d355b8469247 (patch) | |
tree | 76ed4ed34130103c9467142d2444bada3e1150ce /fs/namei.c | |
parent | 73ff61dbe5edeb1799d7e91c8b0641f87feb75fa (diff) | |
download | linux-4a770891d9ddf94df985ca438e78d355b8469247.tar.xz |
Btrfs: fix parity scrub of RAID 5/6 with missing device
When testing the previous patch, Zhao Lei reported a similar bug when
attempting to scrub a degraded RAID 5/6 filesystem with a missing
device, leading to NULL pointer dereferences from the RAID 5/6 parity
scrubbing code.
The first cause was the same as in the previous patch: attempting to
call bio_add_page() on a missing block device. To fix this,
scrub_extent_for_parity() can just mark the sectors on the missing
device as errors instead of attempting to read from it.
Additionally, the code uses scrub_remap_extent() to map the extent of
the corresponding data stripe, but the extent wasn't already mapped. If
scrub_remap_extent() finds a missing block device, it doesn't initialize
extent_dev, so we're left with a NULL struct btrfs_device. The solution
is to use btrfs_map_block() directly.
Reported-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/namei.c')
0 files changed, 0 insertions, 0 deletions