dm table: establish queue limits by copying table limits

Copy the table's queue_limits to the DM device's request_queue. This
properly initializes the queue's topology limits and also avoids having
to track the evolution of 'struct queue_limits' in
dm_table_set_restrictions()

Also fixes a bug that was introduced in dm_table_set_restrictions() via
commit ae03bf639a5027d27270123f5f6e3ee6a412781d. In addition to
establishing 'bounce_pfn' in the queue's limits blk_queue_bounce_limit()
also performs an allocation to setup the ISA DMA pool. This allocation
resulted in "sleeping function called from invalid context" when called
from dm_table_set_restrictions().

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
1197764e 5ab97588

+2 -10
+2 -10
drivers/md/dm-table.c
··· 956 956 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q) 957 957 { 958 958 /* 959 - * Make sure we obey the optimistic sub devices 960 - * restrictions. 959 + * Copy table's limits to the DM device's request_queue 961 960 */ 962 - blk_queue_max_sectors(q, t->limits.max_sectors); 963 - blk_queue_max_phys_segments(q, t->limits.max_phys_segments); 964 - blk_queue_max_hw_segments(q, t->limits.max_hw_segments); 965 - blk_queue_logical_block_size(q, t->limits.logical_block_size); 966 - blk_queue_max_segment_size(q, t->limits.max_segment_size); 967 - blk_queue_max_hw_sectors(q, t->limits.max_hw_sectors); 968 - blk_queue_segment_boundary(q, t->limits.seg_boundary_mask); 969 - blk_queue_bounce_limit(q, t->limits.bounce_pfn); 961 + q->limits = t->limits; 970 962 971 963 if (t->limits.no_cluster) 972 964 queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);