Commit 2d67344e authored by Mike Snitzer's avatar Mike Snitzer Committed by Kleber Sacilotto de Souza

dm thin metadata: fix __udivdi3 undefined on 32-bit

BugLink: https://bugs.launchpad.net/bugs/1798770

commit 013ad043 upstream.

sector_div() is only viable for use with sector_t.
dm_block_t is typedef'd to uint64_t -- so use div_u64() instead.

Fixes: 3ab91828 ("dm thin metadata: try to avoid ever aborting transactions")
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent a04c787d
...@@ -843,10 +843,8 @@ static void __set_metadata_reserve(struct dm_pool_metadata *pmd) ...@@ -843,10 +843,8 @@ static void __set_metadata_reserve(struct dm_pool_metadata *pmd)
if (r) { if (r) {
DMERR("could not get size of metadata device"); DMERR("could not get size of metadata device");
pmd->metadata_reserve = max_blocks; pmd->metadata_reserve = max_blocks;
} else { } else
sector_div(total, 10); pmd->metadata_reserve = min(max_blocks, div_u64(total, 10));
pmd->metadata_reserve = min(max_blocks, total);
}
} }
struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment