Browse Source

[PATCH] dm mirror log: bitset_size fix

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 <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alasdair G Kergon 19 years ago
parent
commit
29121bd0b0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/md/dm-log.c

+ 2 - 2
drivers/md/dm-log.c

@@ -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.
 	 * Work out how many "unsigned long"s we need to hold the bitset.
 	 */
 	 */
 	bitset_size = dm_round_up(region_count,
 	bitset_size = dm_round_up(region_count,
-				  sizeof(unsigned long) << BYTE_SHIFT);
+				  sizeof(*lc->clean_bits) << BYTE_SHIFT);
 	bitset_size >>= 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?
 	 * Disk log?