Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1334008
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.3 011/200] block: Always check queue limits for cloned requests |
| Date | 2016-02-15 01:30 +0100 |
| Message-ID | <r2fda-1KG-61@gated-at.bofh.it> (permalink) |
| References | <r2duF-zw-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <hare@suse.de>
commit bf4e6b4e757488dee1b6a581f49c7ac34cd217f8 upstream.
When a cloned request is retried on other queues it always needs
to be checked against the queue limits of that queue.
Otherwise the calculations for nr_phys_segments might be wrong,
leading to a crash in scsi_init_sgtable().
To clarify this the patch renames blk_rq_check_limits()
to blk_cloned_rq_check_limits() and removes the symbol
export, as the new function should only be used for
cloned requests and never exported.
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Ewan Milne <emilne@redhat.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Fixes: e2a60da74 ("block: Clean up special command handling logic")
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
block/blk-core.c | 21 +++++++--------------
include/linux/blkdev.h | 1 -
2 files changed, 7 insertions(+), 15 deletions(-)
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2023,7 +2023,8 @@ void submit_bio(int rw, struct bio *bio)
EXPORT_SYMBOL(submit_bio);
/**
- * blk_rq_check_limits - Helper function to check a request for the queue limit
+ * blk_cloned_rq_check_limits - Helper function to check a cloned request
+ * for new the queue limits
* @q: the queue
* @rq: the request being checked
*
@@ -2034,20 +2035,13 @@ EXPORT_SYMBOL(submit_bio);
* after it is inserted to @q, it should be checked against @q before
* the insertion using this generic function.
*
- * This function should also be useful for request stacking drivers
- * in some cases below, so export this function.
* Request stacking drivers like request-based dm may change the queue
- * limits while requests are in the queue (e.g. dm's table swapping).
- * Such request stacking drivers should check those requests against
- * the new queue limits again when they dispatch those requests,
- * although such checkings are also done against the old queue limits
- * when submitting requests.
+ * limits when retrying requests on other queues. Those requests need
+ * to be checked against the new queue limits again during dispatch.
*/
-int blk_rq_check_limits(struct request_queue *q, struct request *rq)
+static int blk_cloned_rq_check_limits(struct request_queue *q,
+ struct request *rq)
{
- if (!rq_mergeable(rq))
- return 0;
-
if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, rq->cmd_flags)) {
printk(KERN_ERR "%s: over max size limit.\n", __func__);
return -EIO;
@@ -2067,7 +2061,6 @@ int blk_rq_check_limits(struct request_q
return 0;
}
-EXPORT_SYMBOL_GPL(blk_rq_check_limits);
/**
* blk_insert_cloned_request - Helper for stacking drivers to submit a request
@@ -2079,7 +2072,7 @@ int blk_insert_cloned_request(struct req
unsigned long flags;
int where = ELEVATOR_INSERT_BACK;
- if (blk_rq_check_limits(q, rq))
+ if (blk_cloned_rq_check_limits(q, rq))
return -EIO;
if (rq->rq_disk &&
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -767,7 +767,6 @@ extern void blk_rq_set_block_pc(struct r
extern void blk_requeue_request(struct request_queue *, struct request *);
extern void blk_add_request_payload(struct request *rq, struct page *page,
unsigned int len);
-extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
extern int blk_lld_busy(struct request_queue *q);
extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
struct bio_set *bs, gfp_t gfp_mask,
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.3 000/200] 4.3.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:20 +0100
[PATCH 4.3 012/200] dm btree: fix leak of bufio-backed block in btree_split_sibling error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
[PATCH 4.3 014/200] block: ensure to split after potentially bouncing a bio Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
[PATCH 4.3 001/200] crypto: crc32c-pclmul - use .rodata instead of .rotata Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
[PATCH 4.3 010/200] crypto: sun4i-ss - add missing statesize Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
[PATCH 4.3 015/200] NFSv4.1/pnfs: Fixup an lo->plh_block_lgets imbalance in layoutreturn Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
[PATCH 4.3 011/200] block: Always check queue limits for cloned requests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Guenter Roeck <linux@roeck-us.net> - 2016-02-15 01:50 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 02:00 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-15 16:20 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-15 18:20 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-17 21:40 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-17 21:50 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-18 04:20 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-19 23:30 +0100
Re: [PATCH 4.3 000/200] 4.3.6-stable review Guenter Roeck <linux@roeck-us.net> - 2016-02-15 16:50 +0100
csiph-web