dm log: fix create_log_context to use logical_block_size of log device

create_log_context() must use the logical_block_size from the log disk,
where the I/O happens, not the target's logical_block_size.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by

Mike Snitzer and committed by
Alasdair G Kergon
18d8594d af4874e0

+4 -3
+4 -3
drivers/md/dm-log.c
··· 412 412 /* 413 413 * Buffer holds both header and bitset. 414 414 */ 415 - buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) + 416 - bitset_size, 417 - ti->limits.logical_block_size); 415 + buf_size = 416 + dm_round_up((LOG_OFFSET << SECTOR_SHIFT) + bitset_size, 417 + bdev_logical_block_size(lc->header_location. 418 + bdev)); 418 419 419 420 if (buf_size > i_size_read(dev->bdev->bd_inode)) { 420 421 DMWARN("log device %s too small: need %llu bytes",