]> git.itanic.dy.fi Git - linux-stable/commit
md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()
authorYu Kuai <yukuai3@huawei.com>
Wed, 24 May 2023 01:41:18 +0000 (09:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:20 +0000 (10:34 +0200)
commitcbfed647fd19131bf5e1a5e7bdabefde2dfebab2
tree5c3af68788b6176715dc94ef66a94583237359b1
parent704842c97aa35e587a287c22c57582a330dd0f57
md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()

commit 8557dc27126949c702bd3aafe8a7e0b7e4fcb44c upstream.

'end_sector' is compared to 'rdev->recovery_offset', which is offset to
rdev, however, commit e82ed3a4fbb5 ("md/raid6: refactor
raid5_read_one_chunk") changes the calculation of 'end_sector' to offset
to the array. Fix this miscalculation.

Fixes: e82ed3a4fbb5 ("md/raid6: refactor raid5_read_one_chunk")
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230524014118.3172781-1-yukuai1@huaweicloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid5.c