Commit b0f01ecf authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Song Liu

md/raid5: use bio_end_sector to calculate last_sector

Use the common way to get last_sector.
Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent 07f1a685
...@@ -5499,7 +5499,7 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi) ...@@ -5499,7 +5499,7 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi)
return; return;
logical_sector = bi->bi_iter.bi_sector & ~((sector_t)STRIPE_SECTORS-1); logical_sector = bi->bi_iter.bi_sector & ~((sector_t)STRIPE_SECTORS-1);
last_sector = bi->bi_iter.bi_sector + (bi->bi_iter.bi_size>>9); last_sector = bio_end_sector(bi);
bi->bi_next = NULL; bi->bi_next = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment