mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
Squashfs: don't allocate fragment caches more than fragments
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@huawei.com Signed-off-by: pangliyuan <pangliyuan1@huawei.com> Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> Cc: <wangfangpeng1@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
0fafc9e156
commit
78188dd1d2
|
|
@ -405,7 +405,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user