mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
btrfs: fix minimum number of chunk errors for DUP
[ Upstream commit0ee5f8ae08] The list of profiles in btrfs_chunk_max_errors lists DUP as a profile DUP able to tolerate 1 device missing. Though this profile is special with 2 copies, it still needs the device, unlike the others. Looking at the history of changes, thre's no clear reason why DUP is there, functions were refactored and blocks of code merged to one helper.d20983b40eBtrfs: fix writing data into the seed filesystem - factor code to a helperde11cc12dfBtrfs: don't pre-allocate btrfs bio - unrelated change, DUP still in the list with max errors 1a236aed14cBtrfs: Deal with failed writes in mirrored configurations - introduced the max errors, leaves DUP and RAID1 in the same group Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
72d9c89015
commit
ff35fc5969
@@ -5019,8 +5019,7 @@ static inline int btrfs_chunk_max_errors(struct map_lookup *map)
|
||||
|
||||
if (map->type & (BTRFS_BLOCK_GROUP_RAID1 |
|
||||
BTRFS_BLOCK_GROUP_RAID10 |
|
||||
BTRFS_BLOCK_GROUP_RAID5 |
|
||||
BTRFS_BLOCK_GROUP_DUP)) {
|
||||
BTRFS_BLOCK_GROUP_RAID5)) {
|
||||
max_errors = 1;
|
||||
} else if (map->type & BTRFS_BLOCK_GROUP_RAID6) {
|
||||
max_errors = 2;
|
||||
|
||||
Reference in New Issue
Block a user