fuse fixes for 6.14-rc4
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSQHSd0lITzzeNWNm3h3BK/laaZPAUCZ7MX2QAKCRDh3BK/laaZ PO/sAQDDx1zbxg1zPLRUj3ldVc1YA8VbpWcFnAS2EGlmHTmsqgD/cGQhmHtEQ5y5 oaSCWH+u+PK0U/XZwdPBuEszyyMcXgY= =GHfc -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCZ7Q7LwAKCRCRxhvAZXjc okTiAQCLbpstPOm62+LN9C8Qw9lJa3WBXAXZi2sHTdD8ucy7wgEAjKvriO5ZvUBL Vr9bIUabO4nB91juLInS5s1xna3xfgk= =2T5u -----END PGP SIGNATURE----- Merge tag 'fuse-fixes-6.14-rc4' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse 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: Christian Brauner <brauner@kernel.org>
This commit is contained in:
commit
b8d975e7cc
2 changed files with 17 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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++;
|
||||
|
|
Loading…
Add table
Reference in a new issue