On Wed, Nov 06, 2024 at 03:33:38PM +0530, Kundan Kumar wrote: >> -int bio_add_page(struct bio *bio, struct page *page, >> - unsigned int len, unsigned int offset) >> +static int bio_do_add_page(struct bio *bio, struct page *page, >> + unsigned int len, unsigned int offset, bool *same_page) > > As we are passing length within a folio, values will reach near UINT_MAX. > It will be better to make len and offset as size_t, also to add a check like : > if (len > UINT_MAX || offset > UINT_MAX) > return 0; Not sure what the point is. IFF we get folio sizes overflowing an unsigned int we'll have a massive problem as it will overflow the bv_offset and bv_len fields. So we'd need to address that first before doing anything else. >> { >> - bool same_page = false; > > nit: extra line got added Yes, the previous code was missing the empty line after the variable declaration, so this got fixed.