[PATCH 04/16] squashfs: unmap the current page when a readahead fragment copy fails
From: Tal Zussman
Date: Tue Nov 03 2026 - 08:33:50 EST
If copying the fragment into the readahead pages fails,
squashfs_readahead_fragment() frees the page actor while the current
page is still mapped with kmap_local_page() and never unmaps it.
Call squashfs_finish_page() before freeing the actor, like the success
path does through squashfs_next_page().
Fixes: b09a7a036d20 ("squashfs: support reading fragments in readahead call")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/squashfs/file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c
index 12263ec8494b..39142c4e08c4 100644
--- a/fs/squashfs/file.c
+++ b/fs/squashfs/file.c
@@ -565,6 +565,7 @@ static int squashfs_readahead_fragment(struct inode *inode, struct page **page,
return 0;
failed:
+ squashfs_finish_page(actor);
squashfs_page_actor_free(actor);
out:
--
2.39.5