On 09/09/24 10:23PM, Matthew Wilcox wrote:
On Fri, Aug 30, 2024 at 01:22:55PM +0530, Kundan Kumar wrote:
@@ -1237,30 +1238,61 @@ static int bio_iov_add_page(struct bio *bio, struct page *page,
if (bio->bi_vcnt > 0 &&
bvec_try_merge_page(&bio->bi_io_vec[bio->bi_vcnt - 1],
- page, len, offset, &same_page)) {
+ folio_page(folio, 0), len, offset,
+ &same_page)) {
bio->bi_iter.bi_size += len;
if (same_page)
- bio_release_page(bio, page);
+ bio_release_page(bio, folio_page(folio, 0));
Shouldn't there be a subsequent patch that converts this to
Will do it in next version
if (same_page && bio_flagged(bio, BIO_PAGE_PINNED))
unpin_user_folio(folio, 1)
... also does this mean that 'same_page' is misnamed and it should
really be 'same_folio', in which case, is the bugfix in patch 1 correct?
No, we want to find same page rather than same folio. The logic still
determines whether two addresses lie in the same page. It's just
modified to take care of larger offset values that we may receive in
case of folios.