Skip to content

Commit

Permalink
dm thin metadata: fix __udivdi3 undefined on 32-bit
Browse files Browse the repository at this point in the history
commit 013ad04 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: 3ab9182 ("dm thin metadata: try to avoid ever aborting transactions")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mike Snitzer authored and Greg Kroah-Hartman committed Oct 10, 2018
1 parent 07f79b3 commit 4e7ea65
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,8 @@ static void __set_metadata_reserve(struct dm_pool_metadata *pmd)
if (r) {
DMERR("could not get size of metadata device");
pmd->metadata_reserve = max_blocks;
} else {
sector_div(total, 10);
pmd->metadata_reserve = min(max_blocks, total);
}
} else
pmd->metadata_reserve = min(max_blocks, div_u64(total, 10));
}

struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
Expand Down

0 comments on commit 4e7ea65

Please sign in to comment.