From: Qu Wenruo Date: Fri, 13 May 2022 08:34:29 +0000 (+0800) Subject: btrfs: use btrfs_chunk_max_errors() to replace tolerance calculation X-Git-Tag: baikal/mips/sdk6.1~5160^2~82 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=72de93777293e136c72171dee99861b36f67c8a6;p=kernel.git btrfs: use btrfs_chunk_max_errors() to replace tolerance calculation 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 Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e12b139586e09..75a59423a1bfe 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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;