Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH 0/2] ext4: fix data loss when reading during inline data conversion
@ 2026-12-03 10:06 Florian Schmaus
  2026-12-03 10:06 ` [PATCH 1/2] ext4: don't zero uptodate buffers in ext4_readpage_inline() Florian Schmaus
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Florian Schmaus @ 2026-12-03 10:06 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Baokun Li, Jan Kara,
	Ojaswin Mujoo, Ritesh Harjani (IBM), Zhang Yi, Tao Ma
  Cc: linux-ext4, Florian Schmaus, Ulrich Müller, stable

Ulrich reported that on ext4 with 1 KiB blocks and inline_data, files
written with many small writes can end up with NUL bytes at the end [1].
Gentoo's portage ran into it once Python 3.14 started to read files with
a larger buffer.

After a delalloc conversion of inline data, ext4_readpage_inline() keeps
handling reads until writeback, and it zero-fills folios that already
hold written, uptodate buffers. Patch 1 fixes this and is tagged for
stable. Patch 2 adds a KUnit case for it. It is not tagged for stable,
as the inline data KUnit tests are new in 7.4.

Tested on 7.4-rc5 with files written as in the reproducer from patch 1
and read back through read(2), mmap, splice and sendfile. Without the
fix, all of these return NUL bytes, and the zeroes end up on disk. With
the fix, none do. All 562 ext4 KUnit tests pass, and the new case fails
without the fix.

[1] https://lore.kernel.org/ucxrjwzcv@gentoo.org

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
---
Florian Schmaus (2):
      ext4: don't zero uptodate buffers in ext4_readpage_inline()
      ext4: test that ext4_readpage_inline() keeps uptodate buffers

 fs/ext4/inline-test.c | 36 ++++++++++++++++++++++++++++++++++++
 fs/ext4/inline.c      | 40 +++++++++++++++++++++++++++++++++++++---
 2 files changed, 73 insertions(+), 3 deletions(-)
---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261203-ext4-inline-readpage-400817c74e13

Best regards,
--  
Florian Schmaus <flo@geekplace.eu>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-03 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 10:06 [PATCH 0/2] ext4: fix data loss when reading during inline data conversion Florian Schmaus
2026-12-03 10:06 ` [PATCH 1/2] ext4: don't zero uptodate buffers in ext4_readpage_inline() Florian Schmaus
2026-12-03 10:06 ` [PATCH 2/2] ext4: test that ext4_readpage_inline() keeps uptodate buffers Florian Schmaus
2026-12-03 10:17   ` sashiko-bot
2026-12-03 10:30 ` [PATCH 0/2] ext4: fix data loss when reading during inline data conversion sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox