From 079220c56f83b8abaf74724903c52cbad06d7163 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Feb 2026 17:06:28 -0800 Subject: f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster() Remove the unnecessary clearing of PG_uptodate. It's guaranteed to already be clear. Suggested-by: Matthew Wilcox Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20260218010630.7407-2-ebiggers@kernel.org Signed-off-by: Eric Biggers --- fs/f2fs/compress.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 006a80acd1de..355762d11e25 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1819,8 +1819,6 @@ static void f2fs_verify_cluster(struct work_struct *work) if (fsverity_verify_page(dic->vi, rpage)) SetPageUptodate(rpage); - else - ClearPageUptodate(rpage); unlock_page(rpage); } -- cgit v1.2.3 From 78cdb14893614dc46a06fe075abf19e0d8eddc66 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Feb 2026 17:06:29 -0800 Subject: f2fs: make f2fs_verify_cluster() partially large-folio-aware f2fs_verify_cluster() is the only remaining caller of the non-large-folio-aware function fsverity_verify_page(). To unblock the removal of that function, change f2fs_verify_cluster() to verify the entire folio of each page and mark it up-to-date. Note that this doesn't actually make f2fs_verify_cluster() large-folio-aware, as it is still passed an array of pages. Currently, it's never called with large folios. Suggested-by: Matthew Wilcox Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20260218010630.7407-3-ebiggers@kernel.org Signed-off-by: Eric Biggers --- fs/f2fs/compress.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 355762d11e25..8c76400ba631 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1813,13 +1813,14 @@ static void f2fs_verify_cluster(struct work_struct *work) /* Verify, update, and unlock the decompressed pages. */ for (i = 0; i < dic->cluster_size; i++) { struct page *rpage = dic->rpages[i]; + struct folio *rfolio; if (!rpage) continue; - - if (fsverity_verify_page(dic->vi, rpage)) - SetPageUptodate(rpage); - unlock_page(rpage); + rfolio = page_folio(rpage); + if (fsverity_verify_folio(dic->vi, rfolio)) + folio_mark_uptodate(rfolio); + folio_unlock(rfolio); } f2fs_put_dic(dic, true); -- cgit v1.2.3 From 5959495449caf325a0394602568e287f2b829818 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Feb 2026 17:06:30 -0800 Subject: fsverity: remove fsverity_verify_page() Now that fsverity_verify_page() has no callers, remove it. Suggested-by: Linus Torvalds Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20260218010630.7407-4-ebiggers@kernel.org Signed-off-by: Eric Biggers --- fs/verity/verify.c | 4 ++-- include/linux/fsverity.h | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/verity/verify.c b/fs/verity/verify.c index 31797f9b24d0..3e38749fbc82 100644 --- a/fs/verity/verify.c +++ b/fs/verity/verify.c @@ -433,8 +433,8 @@ EXPORT_SYMBOL_GPL(fsverity_verify_blocks); * This is a helper function for use by the ->readahead() method of filesystems * that issue bios to read data directly into the page cache. Filesystems that * populate the page cache without issuing bios (e.g. non block-based - * filesystems) must instead call fsverity_verify_page() directly on each page. - * All filesystems must also call fsverity_verify_page() on holes. + * filesystems) must instead call fsverity_verify_blocks() directly. All + * filesystems must also call fsverity_verify_blocks() on holes. */ void fsverity_verify_bio(struct fsverity_info *vi, struct bio *bio) { diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index fed91023bea9..6de3ddf0b148 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -282,12 +282,6 @@ static inline bool fsverity_verify_folio(struct fsverity_info *vi, return fsverity_verify_blocks(vi, folio, folio_size(folio), 0); } -static inline bool fsverity_verify_page(struct fsverity_info *vi, - struct page *page) -{ - return fsverity_verify_blocks(vi, page_folio(page), PAGE_SIZE, 0); -} - /** * fsverity_file_open() - prepare to open a verity file * @inode: the inode being opened -- cgit v1.2.3 From 693680b9add63dbebb2505a553ff52f8c706c8c0 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Feb 2026 17:22:44 -0800 Subject: fsverity: fix build error by adding fsverity_readahead() stub hppa-linux-gcc 9.5.0 generates a call to fsverity_readahead() in f2fs_readahead() when CONFIG_FS_VERITY=n, because it fails to do the expected dead code elimination based on vi always being NULL. Fix the build error by adding an inline stub for fsverity_readahead(). Since it's just for opportunistic readahead, just make it a no-op. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202602180838.pwICdY2r-lkp@intel.com/ Fixes: 45dcb3ac9832 ("f2fs: consolidate fsverity_info lookup") Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20260218012244.18536-1-ebiggers@kernel.org Signed-off-by: Eric Biggers --- include/linux/fsverity.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index 6de3ddf0b148..a8f9aa75b792 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -195,6 +195,8 @@ int fsverity_ioctl_read_metadata(struct file *filp, const void __user *uarg); /* verify.c */ +void fsverity_readahead(struct fsverity_info *vi, pgoff_t index, + unsigned long nr_pages); bool fsverity_verify_blocks(struct fsverity_info *vi, struct folio *folio, size_t len, size_t offset); void fsverity_verify_bio(struct fsverity_info *vi, struct bio *bio); @@ -255,6 +257,11 @@ static inline int fsverity_ioctl_read_metadata(struct file *filp, /* verify.c */ +static inline void fsverity_readahead(struct fsverity_info *vi, pgoff_t index, + unsigned long nr_pages) +{ +} + static inline bool fsverity_verify_blocks(struct fsverity_info *vi, struct folio *folio, size_t len, size_t offset) @@ -303,8 +310,6 @@ static inline int fsverity_file_open(struct inode *inode, struct file *filp) } void fsverity_cleanup_inode(struct inode *inode); -void fsverity_readahead(struct fsverity_info *vi, pgoff_t index, - unsigned long nr_pages); struct page *generic_read_merkle_tree_page(struct inode *inode, pgoff_t index); void generic_readahead_merkle_tree(struct inode *inode, pgoff_t index, -- cgit v1.2.3