dm writecache: allow allocations larger than 2GiB
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 9 Jan 2024 15:00:57 +0000 (16:00 +0100)
committerMike Snitzer <snitzer@kernel.org>
Tue, 30 Jan 2024 19:07:30 +0000 (14:07 -0500)
commit40ef8756fbdd9faec4da5d70352b28f1196132ed
tree72a4b244381deac50876953f9a3d1c0e6b8c10d0
parent9cf11ce06ea52911245578032761e40a6409cf35
dm writecache: allow allocations larger than 2GiB

The function kvmalloc_node limits the allocation size to INT_MAX. This
limit will be overflowed if dm-writecache attempts to map a device with
1TiB or larger length. This commit changes kvmalloc_array to vmalloc_array
to avoid the limit.

The commit also changes vmalloc(array_size()) to vmalloc_array().

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-writecache.c