Re: [PATCH -next v5 13/32] ext4: pass out extent seq counter when mapping da blocks
| Newsgroups | org.kernel.vger.linux-ext4 |
|---|---|
| Message-ID | <[email protected]> |
> From: Zhang Yi <[email protected]> > > The iomap buffered write path does not hold the folio lock between > mapping the inode extent and copying data. Therefore, it can race > with writeback that modifies the extent type (e.g., from unwritten to > written). This can lead to data corruption on partial writes, as > iomap_block_needs_zeroing() may return a false positive based on a > stale extent. The iomap infrastructure uses the sequence counter > stored in the inode to detect such stale mappings. > > Commit 07c440e8da8f ("ext4: pass out extent seq counter when mapping > blocks") added the m_seq field to ext4_map_blocks to pass out extent > sequence numbers, but it missed two callsites within > ext4_da_map_blocks(). These callsites are on the delayed allocation > path, which is needed in the iomap buffered write path. Pass out the > sequence counter to ensure stale mappings can be detected. > > Signed-off-by: Zhang Yi <[email protected]> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13