mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: stable@kernel.org
This commit is contained in:
parent
b69d3987f4
commit
924362629b
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ struct pstore {
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue