Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0341aafb authored by Jens Axboe's avatar Jens Axboe
Browse files

block: fix bad use of min() on different types



Just cast the page size to sector_t, that will always fit.

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 50eaeb32
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ struct bio_batch
static void bio_batch_end_io(struct bio *bio, int err)
{
	struct bio_batch *bb = bio->bi_private;

	if (err) {
		if (err == -EOPNOTSUPP)
			set_bit(BIO_EOPNOTSUPP, &bb->flags);
@@ -187,7 +188,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
			bio->bi_private = &bb;

		while (nr_sects != 0) {
			sz = min(PAGE_SIZE >> 9 , nr_sects);
			sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects);
			if (sz == 0)
				/* bio has maximum size possible */
				break;