From: Alasdair G Kergon Date: Mon, 26 Jun 2006 07:27:29 +0000 (-0700) Subject: [PATCH] dm mirror log: bitset_size fix X-Git-Tag: v2.6.18-rc1~657 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29121bd0b00ebb9524971a583fea4a2f7afe8041;p=linux-2.6 [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index f52a78fc82..33d8072166 100644 --- a/drivers/md/dm-log.c +++ b/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. */ 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?