Correct calculation of the dirty logs bitset size. --- diff/drivers/md/dm-log.c 2003-10-16 10:44:23.000000000 +0100 +++ source/drivers/md/dm-log.c 2003-10-16 10:45:18.000000000 +0100 @@ -124,6 +124,7 @@ int sync_search; }; +#define BYTE_SHIFT 3 static int core_ctr(struct dirty_log *log, sector_t dev_size, unsigned int argc, char **argv) { @@ -153,7 +154,13 @@ clog->region_size = region_size; clog->region_count = region_count; - bitset_size = dm_round_up(region_count >> 3, sizeof(*clog->clean_bits)); + /* + * Work out how many words we need to hold the bitset. + */ + bitset_size = dm_round_up(region_count, + sizeof(*clog->clean_bits) << BYTE_SHIFT); + bitset_size >>= BYTE_SHIFT; + clog->clean_bits = vmalloc(bitset_size); if (!clog->clean_bits) { DMWARN("couldn't allocate clean bitset");