diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2010-04-29 09:28:21 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-04-29 09:28:21 +0200 |
commit | 0341aafb7f3313bcedc6811a098500be85f3fc77 (patch) | |
tree | 844d674e4f4a9f5200d71f0e71f15e1e9e0daad9 /block/blk-lib.c | |
parent | 50eaeb323a170e231263ccb433bb2f99bd9e27ac (diff) | |
download | lwn-0341aafb7f3313bcedc6811a098500be85f3fc77.tar.gz lwn-0341aafb7f3313bcedc6811a098500be85f3fc77.zip |
block: fix bad use of min() on different types
Just cast the page size to sector_t, that will always fit.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-lib.c')
-rw-r--r-- | block/blk-lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-lib.c b/block/blk-lib.c index 886c3f9e1be4..d0216b9f22d4 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -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); @@ -186,8 +187,8 @@ submit: if (flags & BLKDEV_IFL_WAIT) bio->bi_private = &bb; - while(nr_sects != 0) { - sz = min(PAGE_SIZE >> 9 , nr_sects); + while (nr_sects != 0) { + sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects); if (sz == 0) /* bio has maximum size possible */ break; |