|
@@ -55,9 +55,11 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
while (nr_sects) {
|
|
while (nr_sects) {
|
|
- unsigned int req_sects = min_t(unsigned int, nr_sects,
|
|
|
|
|
|
+ sector_t req_sects = min_t(sector_t, nr_sects,
|
|
bio_allowed_max_sectors(q));
|
|
bio_allowed_max_sectors(q));
|
|
|
|
|
|
|
|
+ WARN_ON_ONCE((req_sects << 9) > UINT_MAX);
|
|
|
|
+
|
|
bio = blk_next_bio(bio, 0, gfp_mask);
|
|
bio = blk_next_bio(bio, 0, gfp_mask);
|
|
bio->bi_iter.bi_sector = sector;
|
|
bio->bi_iter.bi_sector = sector;
|
|
bio_set_dev(bio, bdev);
|
|
bio_set_dev(bio, bdev);
|