]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fuse: remove fuse_readpages_end() null mapping check
authorJoanne Koong <joannelkoong@gmail.com>
Fri, 29 Aug 2025 23:56:27 +0000 (16:56 -0700)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 2 Sep 2025 09:14:15 +0000 (11:14 +0200)
commit02d47e213dce6e2fa197d0cff66e92f1bc55f00f
treee702fc40c7b6ddb525f1484e4efc4ef0a74ebbb7
parentb3c7ab1d2593213c2d3339830b3950a689e83867
fuse: remove fuse_readpages_end() null mapping check

Remove extra logic in fuse_readpages_end() that checks against null
folio mappings. This was added in commit ce534fb05292 ("fuse: allow
splice to move pages"):

"Since the remove_from_page_cache() + add_to_page_cache_locked()
are non-atomic it is possible that the page cache is repopulated in
between the two and add_to_page_cache_locked() will fail.  This
could be fixed by creating a new atomic replace_page_cache_page()
function.

fuse_readpages_end() needed to be reworked so it works even if
page->mapping is NULL for some or all pages which can happen if the
add_to_page_cache_locked() failed."

Commit ef6a3c63112e ("mm: add replace_page_cache_page() function") added
atomic page cache replacement, which means the check against null
mappings can be removed.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c