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

Commit 92436262 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon
Browse files

dm snapshot: fix chunksize sector conversion



If a snapshot has a smaller chunksize than the page size the
conversion to pages currently returns 0 instead of 1, causing:
kernel BUG in mempool_resize.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
parent b69d3987
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -131,7 +131,7 @@ struct pstore {


static unsigned sectors_to_pages(unsigned sectors)
static unsigned sectors_to_pages(unsigned sectors)
{
{
	return sectors / (PAGE_SIZE >> 9);
	return DIV_ROUND_UP(sectors, PAGE_SIZE >> 9);
}
}


static int alloc_area(struct pstore *ps)
static int alloc_area(struct pstore *ps)