Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db776883 authored by Sridhar Parasuram's avatar Sridhar Parasuram
Browse files

dm-bufio: Ensure reserved buffer is also allocated from get_free_pages pool



In cases where alloc_buffer fails to allocate there is a possibility for
a reserved buffer to be used. Currently the reserved buffer is allocated
from a vmalloc region and later in dm-verity hashing, the use of vmalloc'd
buffer results in a panic in BUG_ON(!virt_addr_valid(buf)) as the operation
is invalid. This change ensures that the reserved buffer is allocated from
a non-vmalloc'd region.

Change-Id: I401787bcc3cbf9c3837d3c7d569774dcce04b6c6
Signed-off-by: default avatarSridhar Parasuram <sridhar@codeaurora.org>
parent 07fb2060
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1730,7 +1730,8 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
	mutex_unlock(&dm_bufio_clients_lock);

	while (c->need_reserved_buffers) {
		struct dm_buffer *b = alloc_buffer(c, GFP_KERNEL);
		struct dm_buffer *b = alloc_buffer(c,
					GFP_KERNEL | __GFP_NORETRY);

		if (!b) {
			r = -ENOMEM;