Re: [PATCH] block: free copied pages when blk_rq_map_kern() fails

Jens Axboe <[email protected]>
Newsgroups org.kernel.vger.linux-block
Message-ID <178420392406.282740.3801237651207755584.b4-ty@b4>
On Wed, 15 Jul 2026 15:35:18 +0800, Jackie Liu wrote:
> bio_copy_kern() allocates pages that are normally freed by the bio
> completion callback. If blk_rq_append_bio() rejects the bio, however,
> blk_rq_map_kern() only drops the bio reference. Since bio_put() does not
> free pages referenced by the bio vectors, those pages leak.
> 
> This can happen when the bio exceeds the queue segment constraints or
> when a later mapping cannot be merged into a request built by earlier
> calls. Track whether the buffer was copied and free those pages before
> dropping the rejected bio.
> 
> [...]

Applied, thanks!

[1/1] block: free copied pages when blk_rq_map_kern() fails
      commit: bd2df8dc72201f626d66ca97f2afc8b7f2740713

Best regards,
-- 
Jens Axboe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.