Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Alasdair G Kergon and committed by
Linus Torvalds
29121bd0 b7cca195

+2 -2
+2 -2
drivers/md/dm-log.c
··· 295 295 * Work out how many "unsigned long"s we need to hold the bitset. 296 296 */ 297 297 bitset_size = dm_round_up(region_count, 298 - sizeof(unsigned long) << BYTE_SHIFT); 298 + sizeof(*lc->clean_bits) << BYTE_SHIFT); 299 299 bitset_size >>= BYTE_SHIFT; 300 300 301 - lc->bitset_uint32_count = bitset_size / 4; 301 + lc->bitset_uint32_count = bitset_size / sizeof(*lc->clean_bits); 302 302 303 303 /* 304 304 * Disk log?