Skip to content

Commit 4f81b87

Browse files
Christoph Hellwigaxboe
authored andcommitted
xen-blkfront: don't redundantly set max_sements in blkif_recover
blkif_set_queue_limits already sets the max_sements limits, so don't do it a second time. Also remove a comment about a long fixe bug in blk_mq_update_nr_hw_queues. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Roger Pau Monné <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 738be13 commit 4f81b87

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/block/xen-blkfront.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,14 +2008,10 @@ static int blkif_recover(struct blkfront_info *info)
20082008
struct request *req, *n;
20092009
int rc;
20102010
struct bio *bio;
2011-
unsigned int segs;
20122011
struct blkfront_ring_info *rinfo;
20132012

20142013
blkfront_gather_backend_features(info);
2015-
/* Reset limits changed by blk_mq_update_nr_hw_queues(). */
20162014
blkif_set_queue_limits(info);
2017-
segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST;
2018-
blk_queue_max_segments(info->rq, segs / GRANTS_PER_PSEG);
20192015

20202016
for_each_rinfo(info, rinfo, r_index) {
20212017
rc = blkfront_setup_indirect(rinfo);
@@ -2035,7 +2031,9 @@ static int blkif_recover(struct blkfront_info *info)
20352031
list_for_each_entry_safe(req, n, &info->requests, queuelist) {
20362032
/* Requeue pending requests (flush or discard) */
20372033
list_del_init(&req->queuelist);
2038-
BUG_ON(req->nr_phys_segments > segs);
2034+
BUG_ON(req->nr_phys_segments >
2035+
(info->max_indirect_segments ? :
2036+
BLKIF_MAX_SEGMENTS_PER_REQUEST));
20392037
blk_mq_requeue_request(req, false);
20402038
}
20412039
blk_mq_start_stopped_hw_queues(info->rq, true);

0 commit comments

Comments
 (0)