]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iomap: release pages on atomic dio size mismatch
authorFengnan Chang <changfengnan@bytedance.com>
Fri, 12 Jun 2026 04:40:41 +0000 (12:40 +0800)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:24 +0000 (15:26 +0200)
commit681e452683b69a8e1a571cba0f238f8ceacf55d2
tree00b665d83978d28f54d4a74901dc3b983fc154d6
parentebebef925281a336ed1d4bbbefaa5d3b00877f28
iomap: release pages on atomic dio size mismatch

If bio_iov_iter_get_pages() or the bounce helper succeeds but builds a
short bio, the REQ_ATOMIC size check rejects it before submission.  The
old error path only dropped the bio reference, leaving any pages already
attached to the bio unreleased.

Release or unbounce the pages before falling through to out_put_bio on
this error path.

This bug was reported by sashiko:
https://sashiko.dev/#/patchset/20260608073134.95964-1-changfengnan%40bytedance.com

Fixes: 9e0933c21c12 ("fs: iomap: Atomic write support")
Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Link: https://patch.msgid.link/20260612044041.10677-1-changfengnan@bytedance.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/iomap/direct-io.c