Skip to content

ext4: never fall back to buffered I/O for atomic direct writes - #1281

Open
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1161607=>linus-master
Open

ext4: never fall back to buffered I/O for atomic direct writes#1281
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1161607=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

Pull request for series with
subject: ext4: never fall back to buffered I/O for atomic direct writes
version: 1
url: https://patchwork.kernel.org/series/1161607/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1161607/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1161607/
version: 1

ext4_dio_write_iter() finishes a short direct write through the page
cache. For an atomic write that path only warns and then continues,
which would tear the write.

This came out of a block device fix [1], where an IOCB_ATOMIC direct
write could complete short when only part of the buffer could be
pinned, with the rest going through the buffered fallback. Christoph
Hellwig noted that ext4 has the same fallback and only warns in it [2],
and John Garry agreed it should reject the write instead [3].

In contrast to the block device, nothing reaches the branch on ext4
today: iomap requires the mapping to cover the whole atomic write, a
buffer that can't be pinned in full fails in iomap before the bio is
submitted, and a failed page cache invalidation returns -EAGAIN rather
than reaching the buffered fallback. Exclude atomic writes from the
fallback outright instead of WARN()-ing inside it, so any future bug
yields an error rather than a torn write with a WARN().

Link: https://lore.kernel.org/linux-block/20260828-blkdev-fixes-v2-0-32f3f40cebed@columbia.edu/ [1]
Link: https://lore.kernel.org/linux-block/20260907071217.GD934@lst.de/ [2]
Link: https://lore.kernel.org/linux-block/a7752d1e-8ec1-44d1-a266-c287c315e8ab@oracle.com/ [3]
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1161607/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1161607=>linus-master branch from ae7488e to 992ce45 Compare September 12, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant