Skip to content

Commit

Permalink
[PATCH] dm mirror log: bitset_size fix
Browse files Browse the repository at this point in the history
Fix the 'sizeof' in the region log bitmap size calculation: it's uint32_t, not
unsigned long - this breaks on some archs.

Signed-off-by: Alasdair G Kergon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kergon authored and Linus Torvalds committed Jun 26, 2006
1 parent b7cca19 commit 29121bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/dm-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ static int create_log_context(struct dirty_log *log, struct dm_target *ti,
* Work out how many "unsigned long"s we need to hold the bitset.
*/
bitset_size = dm_round_up(region_count,
sizeof(unsigned long) << BYTE_SHIFT);
sizeof(*lc->clean_bits) << BYTE_SHIFT);
bitset_size >>= BYTE_SHIFT;

lc->bitset_uint32_count = bitset_size / 4;
lc->bitset_uint32_count = bitset_size / sizeof(*lc->clean_bits);

/*
* Disk log?
Expand Down

0 comments on commit 29121bd

Please sign in to comment.