diff options
author | Mike Snitzer <snitzer@redhat.com> | 2014-07-19 21:25:46 +0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-08-01 20:30:36 +0400 |
commit | b02465308f13f3266480275fd143747bfd441a2f (patch) | |
tree | bb68d5e7cebb44f8d8b6351fb0510b680921196a /drivers/md | |
parent | fdfb4c8c1a9fc8dd8cf8eeb4e3ed83573b375285 (diff) | |
download | linux-b02465308f13f3266480275fd143747bfd441a2f.tar.xz |
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-cache-target.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index a54108e1e233..1af40ee209e2 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -3094,7 +3094,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits) */ if (io_opt_sectors < cache->sectors_per_block || do_div(io_opt_sectors, cache->sectors_per_block)) { - blk_limits_io_min(limits, 0); + blk_limits_io_min(limits, cache->sectors_per_block << SECTOR_SHIFT); blk_limits_io_opt(limits, cache->sectors_per_block << SECTOR_SHIFT); } set_discard_limits(cache, limits); |