Unverified Commit b8d975e7 authored by Christian Brauner's avatar Christian Brauner
Browse files
Pull fuse fixes from Miklos Szeredi:

This contains a fix for fuse readahead.

* tag 'fuse-fixes-6.14-rc4' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: revert back to __readahead_folio() for readahead

Link: https://lore.kernel.org/r/CAJfpegv=+M4hy=hfBKEgBN8vfWULWT9ApbQzCnPopnMqyjpkzA@mail.gmail.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parents 2408a807 0c67c37e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -838,6 +838,12 @@ static int fuse_check_folio(struct folio *folio)
	return 0;
}

/*
 * Attempt to steal a page from the splice() pipe and move it into the
 * pagecache. If successful, the pointer in @pagep will be updated. The
 * folio that was originally in @pagep will lose a reference and the new
 * folio returned in @pagep will carry a reference.
 */
static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep)
{
	int err;
+11 −2
Original line number Diff line number Diff line
@@ -955,8 +955,10 @@ static void fuse_readpages_end(struct fuse_mount *fm, struct fuse_args *args,
		fuse_invalidate_atime(inode);
	}

	for (i = 0; i < ap->num_folios; i++)
	for (i = 0; i < ap->num_folios; i++) {
		folio_end_read(ap->folios[i], !err);
		folio_put(ap->folios[i]);
	}
	if (ia->ff)
		fuse_file_put(ia->ff, false);

@@ -1048,7 +1050,14 @@ static void fuse_readahead(struct readahead_control *rac)
		ap = &ia->ap;

		while (ap->num_folios < cur_pages) {
			folio = readahead_folio(rac);
			/*
			 * This returns a folio with a ref held on it.
			 * The ref needs to be held until the request is
			 * completed, since the splice case (see
			 * fuse_try_move_page()) drops the ref after it's
			 * replaced in the page cache.
			 */
			folio = __readahead_folio(rac);
			ap->folios[ap->num_folios] = folio;
			ap->descs[ap->num_folios].length = folio_size(folio);
			ap->num_folios++;