Pages don't have indexes, folios have indexes. Correct this in ntfs_read_compressed_block() and also remove a use of page->mapping while I'm in here. Also convert the calls to unlock_page() and flush_dcache_page(). Signed-off-by: Matthew Wilcox (Oracle) Fixes: 495e90fa3348 (ntfs: update attrib operations) Cc: Christoph Hellwig Cc: Hyunchul Lee Cc: Namjae Jeon --- fs/ntfs/compress.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index 143f362a42f5..096e00b967d7 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c @@ -456,14 +456,14 @@ int ntfs_read_compressed_block(struct folio *folio) struct page *page = &folio->page; loff_t i_size; s64 initialized_size; - struct address_space *mapping = page->mapping; + struct address_space *mapping = folio->mapping; struct ntfs_inode *ni = NTFS_I(mapping->host); struct ntfs_volume *vol = ni->vol; struct super_block *sb = vol->sb; struct runlist_element *rl; unsigned long flags; u8 *cb, *cb_pos, *cb_end; - unsigned long offset, index = page->__folio_index; + unsigned long offset, index = folio->index; u32 cb_size = ni->itype.compressed.block_size; u64 cb_size_mask = cb_size - 1UL; s64 vcn; @@ -812,14 +812,16 @@ int ntfs_read_compressed_block(struct folio *folio) for (cur_page = 0; cur_page < max_page; cur_page++) { page = pages[cur_page]; if (page) { + struct folio *folio = page_folio(page); + ntfs_error(vol->sb, "Still have pages left! Terminating them with extreme prejudice. Inode 0x%llx, page index 0x%lx.", - ni->mft_no, page->__folio_index); - flush_dcache_page(page); + ni->mft_no, folio->index); + flush_dcache_folio(folio); kunmap_local(page_address(page)); - unlock_page(page); + folio_unlock(folio); if (cur_page != xpage) - put_page(page); + folio_put(folio); pages[cur_page] = NULL; } } -- 2.47.3