The patch titled Subject: Squashfs: Dont allocate fragment caches more than fragments has been added to the -mm mm-nonmm-unstable branch. Its filename is squashfs-dont-allocate-fragment-caches-more-than-fragments.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/squashfs-dont-allocate-fragment-caches-more-than-fragments.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: pangliyuan <pangliyuan1@xxxxxxxxxx> Subject: Squashfs: Dont allocate fragment caches more than fragments Date: Tue, 10 Dec 2024 17:08:42 +0800 Sometimes the actual number of fragments in image is between 0 and SQUASHFS_CACHED_FRAGMENTS, which cause additional fragment caches to be allocated. Sets the number of fragment caches to the minimum of fragments and SQUASHFS_CACHED_FRAGMENTS. Link: https://lkml.kernel.org/r/20241210090842.160853-1-pangliyuan1@xxxxxxxxxx Signed-off-by: pangliyuan <pangliyuan1@xxxxxxxxxx> Reviewed-by: Phillip Lougher <phillip@xxxxxxxxxxxxxxx> Cc: <wangfangpeng1@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/squashfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/squashfs/super.c~squashfs-dont-allocate-fragment-caches-more-than-fragments +++ a/fs/squashfs/super.c @@ -405,7 +405,7 @@ handle_fragments: goto check_directory_table; msblk->fragment_cache = squashfs_cache_init("fragment", - SQUASHFS_CACHED_FRAGMENTS, msblk->block_size); + min(SQUASHFS_CACHED_FRAGMENTS, fragments), msblk->block_size); if (msblk->fragment_cache == NULL) { err = -ENOMEM; goto failed_mount; _ Patches currently in -mm which might be from pangliyuan1@xxxxxxxxxx are squashfs-dont-allocate-fragment-caches-more-than-fragments.patch