Skip to content

Commit b024653

Browse files
committed
dm cache: set minimum_io_size to cache's data block size
Before, if the block layer's limit stacking didn't establish an optimal_io_size that was compatible with the cache's data block size we'd set optimal_io_size to the data block size and minimum_io_size to 0 (which the block layer adjusts to be physical_block_size). Update cache_io_hints() to set both minimum_io_size and optimal_io_size to the cache's data block size. This fixes an issue where mkfs.xfs would create more XFS Allocation Groups on cache volumes than on a normal linear LV of comparable size. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
1 parent fdfb4c8 commit b024653

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/md/dm-cache-target.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3094,7 +3094,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits)
30943094
*/
30953095
if (io_opt_sectors < cache->sectors_per_block ||
30963096
do_div(io_opt_sectors, cache->sectors_per_block)) {
3097-
blk_limits_io_min(limits, 0);
3097+
blk_limits_io_min(limits, cache->sectors_per_block << SECTOR_SHIFT);
30983098
blk_limits_io_opt(limits, cache->sectors_per_block << SECTOR_SHIFT);
30993099
}
31003100
set_discard_limits(cache, limits);

0 commit comments

Comments
 (0)