diff options
author | Mike Snitzer <snitzer@redhat.com> | 2013-08-20 15:02:41 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2013-08-23 09:02:14 -0400 |
commit | 0cc67cd9c55c4b1f076abca06c922751088e6d86 (patch) | |
tree | cecddf3bbb42ae79bc6262293446d7ad73ba1601 /drivers/md/dm-thin.c | |
parent | a561ddbec156c73ecf2852d77574ddef52970dcf (diff) |
dm thin: fix stacking of geometry limits
Do not blindly override the queue limits (specifically io_min and
io_opt). Allow traditional stacking of these limits if io_opt is a
factor of the thin-pool's data block size.
Without this patch mkfs.xfs does not recognize the thin device's
provided limits as a useful geometry (e.g. raid) so these hints are
ignored. This was due to setting io_min to a useless value.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r-- | drivers/md/dm-thin.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 88f2f802d528..21328a371e58 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -2648,9 +2648,17 @@ static void pool_io_hints(struct dm_target *ti, struct queue_limits *limits) | |||
2648 | { | 2648 | { |
2649 | struct pool_c *pt = ti->private; | 2649 | struct pool_c *pt = ti->private; |
2650 | struct pool *pool = pt->pool; | 2650 | struct pool *pool = pt->pool; |
2651 | uint64_t io_opt_sectors = limits->io_opt >> SECTOR_SHIFT; | ||
2651 | 2652 | ||
2652 | blk_limits_io_min(limits, 0); | 2653 | /* |
2653 | blk_limits_io_opt(limits, pool->sectors_per_block << SECTOR_SHIFT); | 2654 | * If the system-determined stacked limits are compatible with the |
2655 | * pool's blocksize (io_opt is a factor) do not override them. | ||
2656 | */ | ||
2657 | if (io_opt_sectors < pool->sectors_per_block || | ||
2658 | do_div(io_opt_sectors, pool->sectors_per_block)) { | ||
2659 | blk_limits_io_min(limits, 0); | ||
2660 | blk_limits_io_opt(limits, pool->sectors_per_block << SECTOR_SHIFT); | ||
2661 | } | ||
2654 | 2662 | ||
2655 | /* | 2663 | /* |
2656 | * pt->adjusted_pf is a staging area for the actual features to use. | 2664 | * pt->adjusted_pf is a staging area for the actual features to use. |