mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
btrfs: be a bit more careful when setting mirror_num_ret in btrfs_map_block
[ Upstream commit4e7de35eb7
] The mirror_num_ret is allowed to be NULL, although it has to be set when smap is set. Unfortunately that is not a well enough specifiable invariant for static type checkers, so add a NULL check to make sure they are fine. Fixes:03793cbbc8
("btrfs: add fast path for single device io in __btrfs_map_block") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3b1297c4b8
commit
0d7c5934f0
1 changed files with 2 additions and 1 deletions
|
@ -6399,7 +6399,8 @@ int __btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
|
|||
(!need_full_stripe(op) || !dev_replace_is_ongoing ||
|
||||
!dev_replace->tgtdev)) {
|
||||
set_io_stripe(smap, map, stripe_index, stripe_offset, stripe_nr);
|
||||
*mirror_num_ret = mirror_num;
|
||||
if (mirror_num_ret)
|
||||
*mirror_num_ret = mirror_num;
|
||||
*bioc_ret = NULL;
|
||||
ret = 0;
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue