Skip to content

Commit

Permalink
btrfs: use btrfs_chunk_max_errors() to replace tolerance calculation
Browse files Browse the repository at this point in the history
In __btrfs_map_block() we have an assignment to @max_errors using
nr_parity_stripes().

Although it works for RAID56 it's confusing.  Replace it with
btrfs_chunk_max_errors().

Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Qu Wenruo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
adam900710 authored and kdave committed Jul 25, 2022
1 parent bc88b48 commit 6dead96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -6466,7 +6466,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,

/* RAID[56] write or recovery. Return all stripes */
num_stripes = map->num_stripes;
max_errors = nr_parity_stripes(map);
max_errors = btrfs_chunk_max_errors(map);

*length = map->stripe_len;
stripe_index = 0;
Expand Down

0 comments on commit 6dead96

Please sign in to comment.