Re: [PATCH v4 1/2] ext4: use fsdata to track inline data write state and fix race

"Theodore Ts'o" <[email protected]>
Newsgroups org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <178481171744.796182.4771772432914384249.b4-ty@b4>
On Fri, 03 Jul 2026 04:54:12 +0000, Aditya Srivastava wrote:
> Instead of checking the live inode state (ext4_has_inline_data(inode)
> and ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) in the
> write_end handlers, use the fsdata parameter of the address space
> operations to explicitly pass down the state in which write_begin
> prepared the write.
> 
> A concurrent thread (such as ext4_page_mkwrite()) can convert the
> inline data to an extent between write_begin and write_end. If this
> happens, the write_end handlers would previously miss the inline
> write_end path and fall through to extent-based write_end logic.
> However, since block buffers were never allocated in write_begin,
> this resulted in NULL pointer dereferences or data loss because
> folio_buffers(folio) was NULL.
> 
> [...]

Applied, thanks!

[1/2] ext4: use fsdata to track inline data write state and fix race
      commit: 7edbb323bab2b2a609016014caafdb651c898249
[2/2] ext4: cleanup unused CONVERT_INLINE_DATA flag
      commit: f6065852d2137734bcb26c9f94e5daf526179aa9

Best regards,
-- 
Theodore Ts'o <[email protected]>
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.