From: "Matthew Wilcox (Oracle)" Nobody is supposed to use page->__folio_index. Use page_offset() instead, and simplify by working exclusively in loff_t instead of mixing up loff_t and pgoff_t. Link: https://lore.kernel.org/all/20260608210618.3437216-3-willy@infradead.org/ Signed-off-by: Matthew Wilcox (Oracle) Co-developed-by: Hyunchul Lee Signed-off-by: Hyunchul Lee --- fs/ntfs/compress.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index c904858dff3d..8078041b8796 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c @@ -105,13 +105,15 @@ void free_compression_buffers(void) static inline void handle_bounds_compressed_page(struct page *page, const loff_t i_size, const s64 initialized_size) { - if ((page->__folio_index >= (initialized_size >> PAGE_SHIFT)) && + loff_t pos = page_offset(page); + + if ((pos + PAGE_SIZE > initialized_size) && (initialized_size < i_size)) { u8 *kp = page_address(page); unsigned int kp_ofs; ntfs_debug("Zeroing page region outside initialized size."); - if (((s64)page->__folio_index << PAGE_SHIFT) >= initialized_size) { + if (pos >= initialized_size) { clear_page(kp); return; } -- 2.43.0