* [PATCH v2 0/2] fsverity: remove fsverity_verify_page()
@ 2026-02-14 21:18 Eric Biggers
2026-02-14 21:18 ` [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() Eric Biggers
2026-02-14 21:18 ` [PATCH v2 2/2] fsverity: remove fsverity_verify_page() Eric Biggers
0 siblings, 2 replies; 7+ messages in thread
From: Eric Biggers @ 2026-02-14 21:18 UTC (permalink / raw)
To: fsverity
Cc: linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim,
Chao Yu, Eric Biggers
This series removes the non-large-folio-aware function
fsverity_verify_page(), which is no longer needed.
Changed in v2:
- Made one specific part of f2fs_verify_cluster() large-folio-aware.
Eric Biggers (2):
f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page()
fsverity: remove fsverity_verify_page()
fs/f2fs/compress.c | 6 +++++-
fs/verity/verify.c | 4 ++--
include/linux/fsverity.h | 6 ------
3 files changed, 7 insertions(+), 9 deletions(-)
base-commit: 3e48a11675c50698374d4ac596fb506736eb1c53
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() 2026-02-14 21:18 [PATCH v2 0/2] fsverity: remove fsverity_verify_page() Eric Biggers @ 2026-02-14 21:18 ` Eric Biggers 2026-02-14 21:50 ` Eric Biggers 2026-02-14 21:18 ` [PATCH v2 2/2] fsverity: remove fsverity_verify_page() Eric Biggers 1 sibling, 1 reply; 7+ messages in thread From: Eric Biggers @ 2026-02-14 21:18 UTC (permalink / raw) To: fsverity Cc: linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim, Chao Yu, Eric Biggers Replace the only remaining caller of fsverity_verify_page() with a direct call to fsverity_verify_blocks(). This will allow fsverity_verify_page() to be removed. Make it large-folio-aware by using the page's offset in the folio instead of 0, though the rest of f2fs_verify_cluster() and f2fs decompression as a whole still assumes small folios. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Eric Biggers <ebiggers@kernel.org> --- fs/f2fs/compress.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 006a80acd1de..11c4de515f98 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1811,15 +1811,19 @@ static void f2fs_verify_cluster(struct work_struct *work) int i; /* Verify, update, and unlock the decompressed pages. */ for (i = 0; i < dic->cluster_size; i++) { struct page *rpage = dic->rpages[i]; + struct folio *rfolio; + size_t offset; if (!rpage) continue; + rfolio = page_folio(rpage); + offset = folio_page_idx(rfolio, rpage) * PAGE_SIZE; - if (fsverity_verify_page(dic->vi, rpage)) + if (fsverity_verify_blocks(dic->vi, rfolio, PAGE_SIZE, offset)) SetPageUptodate(rpage); else ClearPageUptodate(rpage); unlock_page(rpage); } -- 2.53.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() 2026-02-14 21:18 ` [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() Eric Biggers @ 2026-02-14 21:50 ` Eric Biggers 2026-02-14 22:20 ` Linus Torvalds 2026-02-15 3:38 ` Matthew Wilcox 0 siblings, 2 replies; 7+ messages in thread From: Eric Biggers @ 2026-02-14 21:50 UTC (permalink / raw) To: fsverity Cc: linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim, Chao Yu On Sat, Feb 14, 2026 at 01:18:29PM -0800, Eric Biggers wrote: > Replace the only remaining caller of fsverity_verify_page() with a > direct call to fsverity_verify_blocks(). This will allow > fsverity_verify_page() to be removed. > > Make it large-folio-aware by using the page's offset in the folio > instead of 0, though the rest of f2fs_verify_cluster() and f2fs > decompression as a whole still assumes small folios. > > Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> > Signed-off-by: Eric Biggers <ebiggers@kernel.org> > --- > fs/f2fs/compress.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > index 006a80acd1de..11c4de515f98 100644 > --- a/fs/f2fs/compress.c > +++ b/fs/f2fs/compress.c > @@ -1811,15 +1811,19 @@ static void f2fs_verify_cluster(struct work_struct *work) > int i; > > /* Verify, update, and unlock the decompressed pages. */ > for (i = 0; i < dic->cluster_size; i++) { > struct page *rpage = dic->rpages[i]; > + struct folio *rfolio; > + size_t offset; > > if (!rpage) > continue; > + rfolio = page_folio(rpage); > + offset = folio_page_idx(rfolio, rpage) * PAGE_SIZE; > > - if (fsverity_verify_page(dic->vi, rpage)) > + if (fsverity_verify_blocks(dic->vi, rfolio, PAGE_SIZE, offset)) > SetPageUptodate(rpage); > else > ClearPageUptodate(rpage); > unlock_page(rpage); Let me know if you'd prefer that we verified the whole folio here instead. Either way, the behavior will be still incorrect if this function is passed a large folio (which it's not). Either we'd mark the whole folio up-to-date after verifying only one page in it, or we'd access pages that were not in the array of pages passed to the function. - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() 2026-02-14 21:50 ` Eric Biggers @ 2026-02-14 22:20 ` Linus Torvalds 2026-02-15 3:38 ` Matthew Wilcox 1 sibling, 0 replies; 7+ messages in thread From: Linus Torvalds @ 2026-02-14 22:20 UTC (permalink / raw) To: Eric Biggers Cc: fsverity, linux-f2fs-devel, linux-fsdevel, Jaegeuk Kim, Chao Yu On Sat, 14 Feb 2026 at 13:50, Eric Biggers <ebiggers@kernel.org> wrote: > > Let me know if you'd prefer that we verified the whole folio here > instead. This looks good to me. And hopefully some day that "rpages" becomes "rfolio" (and this can all go away and it becomes fsverity_verify_folio() and simpler). It does look like the "cluster size" thing could maybe be made to simply be the size of one folio for those things, and then being a single folio of size "PAGE_SIZE << i_log_cluster_size" might simplify other code too. Then instead of walking multiple pages, you'd always have exactly one folio (just different sizes depending on cluster size). But that's just from a very quick look, and I might mis-understand the code I saw... Linus ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() 2026-02-14 21:50 ` Eric Biggers 2026-02-14 22:20 ` Linus Torvalds @ 2026-02-15 3:38 ` Matthew Wilcox 2026-02-15 4:11 ` Eric Biggers 1 sibling, 1 reply; 7+ messages in thread From: Matthew Wilcox @ 2026-02-15 3:38 UTC (permalink / raw) To: Eric Biggers Cc: fsverity, linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim, Chao Yu On Sat, Feb 14, 2026 at 01:50:08PM -0800, Eric Biggers wrote: > On Sat, Feb 14, 2026 at 01:18:29PM -0800, Eric Biggers wrote: > > +++ b/fs/f2fs/compress.c > > @@ -1811,15 +1811,19 @@ static void f2fs_verify_cluster(struct work_struct *work) > > int i; > > > > /* Verify, update, and unlock the decompressed pages. */ > > for (i = 0; i < dic->cluster_size; i++) { > > struct page *rpage = dic->rpages[i]; > > + struct folio *rfolio; > > + size_t offset; > > > > if (!rpage) > > continue; > > + rfolio = page_folio(rpage); > > + offset = folio_page_idx(rfolio, rpage) * PAGE_SIZE; > > > > - if (fsverity_verify_page(dic->vi, rpage)) > > + if (fsverity_verify_blocks(dic->vi, rfolio, PAGE_SIZE, offset)) > > SetPageUptodate(rpage); Yeah, no. if (fsverity_verify_blocks(dic->vi, rfolio, folio_size(rfolio), 0)); folio_mark_uptodate(rfolio); > > else > > ClearPageUptodate(rpage); This never needed to be here. The folio must already be !uptodate. Just delete these two lines. > > unlock_page(rpage); folio_unlock(rfolio); ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() 2026-02-15 3:38 ` Matthew Wilcox @ 2026-02-15 4:11 ` Eric Biggers 0 siblings, 0 replies; 7+ messages in thread From: Eric Biggers @ 2026-02-15 4:11 UTC (permalink / raw) To: Matthew Wilcox Cc: fsverity, linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim, Chao Yu On Sun, Feb 15, 2026 at 03:38:20AM +0000, Matthew Wilcox wrote: > On Sat, Feb 14, 2026 at 01:50:08PM -0800, Eric Biggers wrote: > > On Sat, Feb 14, 2026 at 01:18:29PM -0800, Eric Biggers wrote: > > > +++ b/fs/f2fs/compress.c > > > @@ -1811,15 +1811,19 @@ static void f2fs_verify_cluster(struct work_struct *work) > > > int i; > > > > > > /* Verify, update, and unlock the decompressed pages. */ > > > for (i = 0; i < dic->cluster_size; i++) { > > > struct page *rpage = dic->rpages[i]; > > > + struct folio *rfolio; > > > + size_t offset; > > > > > > if (!rpage) > > > continue; > > > + rfolio = page_folio(rpage); > > > + offset = folio_page_idx(rfolio, rpage) * PAGE_SIZE; > > > > > > - if (fsverity_verify_page(dic->vi, rpage)) > > > + if (fsverity_verify_blocks(dic->vi, rfolio, PAGE_SIZE, offset)) > > > SetPageUptodate(rpage); > > Yeah, no. > > if (fsverity_verify_blocks(dic->vi, rfolio, > folio_size(rfolio), 0)); > folio_mark_uptodate(rfolio); > > > > else > > > ClearPageUptodate(rpage); > > This never needed to be here. The folio must already be !uptodate. > Just delete these two lines. > > > > unlock_page(rpage); > > folio_unlock(rfolio); Sure. This kind of scope creep is why I wanted to just do the straightforward conversion for now. - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] fsverity: remove fsverity_verify_page() 2026-02-14 21:18 [PATCH v2 0/2] fsverity: remove fsverity_verify_page() Eric Biggers 2026-02-14 21:18 ` [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() Eric Biggers @ 2026-02-14 21:18 ` Eric Biggers 1 sibling, 0 replies; 7+ messages in thread From: Eric Biggers @ 2026-02-14 21:18 UTC (permalink / raw) To: fsverity Cc: linux-f2fs-devel, linux-fsdevel, Linus Torvalds, Jaegeuk Kim, Chao Yu, Eric Biggers Now that fsverity_verify_page() has no callers, remove it. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Eric Biggers <ebiggers@kernel.org> --- 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 @@ -431,12 +431,12 @@ EXPORT_SYMBOL_GPL(fsverity_verify_blocks); * verification, then bio->bi_status is set to an error status. * * 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) { struct fsverity_verification_context ctx; struct folio_iter fi; 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 @@ -280,16 +280,10 @@ static inline bool fsverity_verify_folio(struct fsverity_info *vi, struct folio *folio) { 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 * @filp: the struct file being set up * -- 2.53.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-02-15 4:12 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-02-14 21:18 [PATCH v2 0/2] fsverity: remove fsverity_verify_page() Eric Biggers 2026-02-14 21:18 ` [PATCH v2 1/2] f2fs: use fsverity_verify_blocks() instead of fsverity_verify_page() Eric Biggers 2026-02-14 21:50 ` Eric Biggers 2026-02-14 22:20 ` Linus Torvalds 2026-02-15 3:38 ` Matthew Wilcox 2026-02-15 4:11 ` Eric Biggers 2026-02-14 21:18 ` [PATCH v2 2/2] fsverity: remove fsverity_verify_page() Eric Biggers
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox