Messages in this thread | | | Date | Mon, 24 Jun 2013 15:51:26 -0700 | From | Tejun Heo <> | Subject | Re: [PATCH] block:Remove extra condition in end of disk check |
| |
On Mon, Jun 24, 2013 at 07:20:12PM +0530, Raghavendra K T wrote: > >@@ -1656,7 +1656,7 @@ static inline int bio_check_eod(struct bio *bio, unsigned int nr_sectors) > > if (maxsector) { > > sector_t sector = bio->bi_sector; > > > >- if (maxsector < nr_sectors || maxsector - nr_sectors < sector) { > >+ if (maxsector - nr_sectors < sector) {
If maxsector < nr_sectors, the subtraction will underflow making it a very large number and fail to detect the invalid condition, no?
Thanks.
-- tejun
| |