LGTM
在 2024/7/13 16:45, Zhang Yi 写道:
hulk inclusion category: perf bugzilla: https://gitee.com/openeuler/kernel/issues/IACNS4 CVE: NA
Current iomap_invalidate_folio() could only invalidate an entire folio, if we truncate a partial folio on a filesystem with blocksize < folio size, it will left over the dirty bits of truncated/punched blocks, and the write back process will try to map the invalid hole range, but fortunately it hasn't trigger any real problems now since ->map() will fix the length. Fix this by supporting invalidating partial folios.
Signed-off-by: Zhang Yi yi.zhang@huawei.com
fs/iomap/buffered-io.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index db191503cfcd..41185c7d4e7c 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -627,6 +627,8 @@ void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len) WARN_ON_ONCE(folio_test_writeback(folio)); folio_cancel_dirty(folio); ifs_free(folio);
- } else {
} } EXPORT_SYMBOL_GPL(iomap_invalidate_folio);iomap_clear_range_dirty(folio, offset, len);