]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: compression: adjust cb->compressed_folios allocation type
authorKees Cook <kees@kernel.org>
Sat, 26 Apr 2025 06:23:29 +0000 (23:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:13:53 +0000 (11:13 +0200)
commitfa027078640bf856f86aa5b20f546ca7312ec73f
treeeee3c1f4a75ff41f6282f853b40abc0f06084d87
parent8784fd831c6511efadbac7c5054aff2cbaa886e1
btrfs: compression: adjust cb->compressed_folios allocation type

[ Upstream commit 6f9a8ab796c6528d22de3c504c81fce7dde63d8a ]

In preparation for making the kmalloc() family of allocators type aware,
we need to make sure that the returned type from the allocation matches
the type of the variable being assigned. (Before, the allocator would
always return "void *", which can be implicitly cast to any pointer type.)

The assigned type is "struct folio **" but the returned type will be
"struct page **". These are the same allocation size (pointer size), but
the types don't match. Adjust the allocation type to match the assignment.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/compression.c