OSDN Git Service

md/raid5: use bio_end_sector to calculate last_sector
authorGuoqing Jiang <jgq516@gmail.com>
Tue, 3 Sep 2019 09:41:03 +0000 (11:41 +0200)
committerSong Liu <songliubraving@fb.com>
Tue, 3 Sep 2019 21:52:38 +0000 (14:52 -0700)
Use the common way to get last_sector.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/raid5.c

index 88e56ee..da6a86e 100644 (file)
@@ -5499,7 +5499,7 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi)
                return;
 
        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;