Skip to content

Commit 8557dc2

Browse files
YuKuai-huaweiliu-song-6
authored andcommitted
md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()
'end_sector' is compared to 'rdev->recovery_offset', which is offset to rdev, however, commit e82ed3a ("md/raid6: refactor raid5_read_one_chunk") changes the calculation of 'end_sector' to offset to the array. Fix this miscalculation. Fixes: e82ed3a ("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
1 parent 3eb9694 commit 8557dc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/raid5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5516,7 +5516,7 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
55165516

55175517
sector = raid5_compute_sector(conf, raid_bio->bi_iter.bi_sector, 0,
55185518
&dd_idx, NULL);
5519-
end_sector = bio_end_sector(raid_bio);
5519+
end_sector = sector + bio_sectors(raid_bio);
55205520

55215521
rcu_read_lock();
55225522
if (r5c_big_stripe_cached(conf, sector))

0 commit comments

Comments
 (0)