Commit fbf33803 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux

Pull fsverity fixes from Eric Biggers:

 - Fix a build error on parisc

 - Remove the non-large-folio-aware function fsverity_verify_page()

* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux:
  fsverity: fix build error by adding fsverity_readahead() stub
  fsverity: remove fsverity_verify_page()
  f2fs: make f2fs_verify_cluster() partially large-folio-aware
  f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster()
parents 75e1f66a 693680b9
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1813,15 +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);
		else
			ClearPageUptodate(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);
+2 −2
Original line number Diff line number Diff line
@@ -442,8 +442,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)
{
+7 −8
Original line number Diff line number Diff line
@@ -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)
@@ -282,12 +289,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
@@ -309,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,