diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-07-14 16:23:21 +0800 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-07-23 11:26:27 +0200 |
| commit | 88c26515313169806a412a362b32a1eca53d21bd (patch) | |
| tree | b2b96d390193e581aa56664fc50d7626b2dcdc73 /rust/zerocopy-derive/git@git.tavy.me:linux.git | |
| parent | 1590cf0329716306e948a8fc29f1d3ee87d3989f (diff) | |
iomap: correct the range of a partial dirty clear
The block range calculation in ifs_clear_range_dirty() is incorrect when
partially clearing a range in a folio. We cannot clear the dirty bit of
the first block or the last block if the start or end offset is not
blocksize-aligned. This has not yet caused any issues since we always
clear a whole folio in iomap_writeback_folio().
Fix this by rounding up the first block to blocksize alignment, and
calculate the last block by rounding down (using truncation). Correct
the nr_blks calculation accordingly.
Fixes: 4ce02c679722 ("iomap: Add per-block dirty state tracking to improve performance")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20260714082325.325163-2-yi.zhang@huaweicloud.com
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'rust/zerocopy-derive/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
