diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-18 17:12:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-18 17:12:39 -0400 |
commit | 70bfc741f845e55227900e4e5770bc359192c564 (patch) | |
tree | 7d71492bd7a3df269d83ece5e5de6fce59774193 | |
parent | edb20a1b4a31fae825470138a45a1ccee1e051c7 (diff) | |
parent | c005390374957baacbc38eef96ea360559510aa7 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
"A small set of fixes that should go into this release. This contains:
- An NVMe pull request from Christoph, with a few select fixes.
One of them fix a polling regression in this series, in which it's
trivial to cause the kernel to disable most of the hardware queue
interrupts.
- Fixup for a blk-mq queue usage imbalance on request allocation,
from Keith.
- A xen block pull request from Konrad, fixing two issues with
xen/xen-blkfront"
* 'for-linus' of git://git.kernel.dk/linux-block:
blk-mq-pci: add a fallback when pci_irq_get_affinity returns NULL
nvme-pci: set cqe_seen on polled completions
nvme-fabrics: fix reporting of unrecognized options
nvmet-fc: eliminate incorrect static markers on local variables
nvmet-fc: correct use after free on list teardown
nvmet: don't overwrite identify sn/fr with 0-bytes
xen-blkfront: use a right index when checking requests
xen: fix bio vec merging
blk-mq: Fix queue usage on failed request allocation
-rw-r--r-- | block/blk-mq-pci.c | 8 | ||||
-rw-r--r-- | block/blk-mq.c | 5 | ||||
-rw-r--r-- | drivers/block/xen-blkfront.c | 6 | ||||
-rw-r--r-- | drivers/nvme/host/fabrics.c | 3 | ||||
-rw-r--r-- | drivers/nvme/host/pci.c | 5 | ||||
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 6 | ||||
-rw-r--r-- | drivers/nvme/target/fc.c | 9 | ||||
-rw-r--r-- | drivers/xen/biomerge.c | 3 |
8 files changed, 22 insertions, 23 deletions
diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c index 0c3354cf3552..76944e3271bf 100644 --- a/block/blk-mq-pci.c +++ b/block/blk-mq-pci.c | |||
@@ -36,12 +36,18 @@ int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev) | |||
36 | for (queue = 0; queue < set->nr_hw_queues; queue++) { | 36 | for (queue = 0; queue < set->nr_hw_queues; queue++) { |
37 | mask = pci_irq_get_affinity(pdev, queue); | 37 | mask = pci_irq_get_affinity(pdev, queue); |
38 | if (!mask) | 38 | if (!mask) |
39 | return -EINVAL; | 39 | goto fallback; |
40 | 40 | ||
41 | for_each_cpu(cpu, mask) | 41 | for_each_cpu(cpu, mask) |
42 | set->mq_map[cpu] = queue; | 42 | set->mq_map[cpu] = queue; |
43 | } | 43 | } |
44 | 44 | ||
45 | return 0; | 45 | return 0; |
46 | |||
47 | fallback: | ||
48 | WARN_ON_ONCE(set->nr_hw_queues > 1); | ||
49 | for_each_possible_cpu(cpu) | ||
50 | set->mq_map[cpu] = 0; | ||
51 | return 0; | ||
46 | } | 52 | } |
47 | EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues); | 53 | EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues); |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 535cbdf32aab..4603b115e234 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -360,12 +360,12 @@ struct request *blk_mq_alloc_request(struct request_queue *q, unsigned int op, | |||
360 | return ERR_PTR(ret); | 360 | return ERR_PTR(ret); |
361 | 361 | ||
362 | rq = blk_mq_get_request(q, NULL, op, &alloc_data); | 362 | rq = blk_mq_get_request(q, NULL, op, &alloc_data); |
363 | blk_queue_exit(q); | ||
363 | 364 | ||
364 | if (!rq) | 365 | if (!rq) |
365 | return ERR_PTR(-EWOULDBLOCK); | 366 | return ERR_PTR(-EWOULDBLOCK); |
366 | 367 | ||
367 | blk_mq_put_ctx(alloc_data.ctx); | 368 | blk_mq_put_ctx(alloc_data.ctx); |
368 | blk_queue_exit(q); | ||
369 | 369 | ||
370 | rq->__data_len = 0; | 370 | rq->__data_len = 0; |
371 | rq->__sector = (sector_t) -1; | 371 | rq->__sector = (sector_t) -1; |
@@ -411,12 +411,11 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, | |||
411 | alloc_data.ctx = __blk_mq_get_ctx(q, cpu); | 411 | alloc_data.ctx = __blk_mq_get_ctx(q, cpu); |
412 | 412 | ||
413 | rq = blk_mq_get_request(q, NULL, op, &alloc_data); | 413 | rq = blk_mq_get_request(q, NULL, op, &alloc_data); |
414 | blk_queue_exit(q); | ||
414 | 415 | ||
415 | if (!rq) | 416 | if (!rq) |
416 | return ERR_PTR(-EWOULDBLOCK); | 417 | return ERR_PTR(-EWOULDBLOCK); |
417 | 418 | ||
418 | blk_queue_exit(q); | ||
419 | |||
420 | return rq; | 419 | return rq; |
421 | } | 420 | } |
422 | EXPORT_SYMBOL_GPL(blk_mq_alloc_request_hctx); | 421 | EXPORT_SYMBOL_GPL(blk_mq_alloc_request_hctx); |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 98e34e4c62b8..2468c28d4771 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -2075,9 +2075,9 @@ static int blkfront_resume(struct xenbus_device *dev) | |||
2075 | /* | 2075 | /* |
2076 | * Get the bios in the request so we can re-queue them. | 2076 | * Get the bios in the request so we can re-queue them. |
2077 | */ | 2077 | */ |
2078 | if (req_op(shadow[i].request) == REQ_OP_FLUSH || | 2078 | if (req_op(shadow[j].request) == REQ_OP_FLUSH || |
2079 | req_op(shadow[i].request) == REQ_OP_DISCARD || | 2079 | req_op(shadow[j].request) == REQ_OP_DISCARD || |
2080 | req_op(shadow[i].request) == REQ_OP_SECURE_ERASE || | 2080 | req_op(shadow[j].request) == REQ_OP_SECURE_ERASE || |
2081 | shadow[j].request->cmd_flags & REQ_FUA) { | 2081 | shadow[j].request->cmd_flags & REQ_FUA) { |
2082 | /* | 2082 | /* |
2083 | * Flush operations don't contain bios, so | 2083 | * Flush operations don't contain bios, so |
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 2e582a240943..5f5cd306f76d 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c | |||
@@ -794,7 +794,8 @@ static int nvmf_check_allowed_opts(struct nvmf_ctrl_options *opts, | |||
794 | int i; | 794 | int i; |
795 | 795 | ||
796 | for (i = 0; i < ARRAY_SIZE(opt_tokens); i++) { | 796 | for (i = 0; i < ARRAY_SIZE(opt_tokens); i++) { |
797 | if (opt_tokens[i].token & ~allowed_opts) { | 797 | if ((opt_tokens[i].token & opts->mask) && |
798 | (opt_tokens[i].token & ~allowed_opts)) { | ||
798 | pr_warn("invalid parameter '%s'\n", | 799 | pr_warn("invalid parameter '%s'\n", |
799 | opt_tokens[i].pattern); | 800 | opt_tokens[i].pattern); |
800 | } | 801 | } |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 74a124a06264..925467b31a33 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -801,6 +801,7 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, | |||
801 | return; | 801 | return; |
802 | } | 802 | } |
803 | 803 | ||
804 | nvmeq->cqe_seen = 1; | ||
804 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe->command_id); | 805 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe->command_id); |
805 | nvme_end_request(req, cqe->status, cqe->result); | 806 | nvme_end_request(req, cqe->status, cqe->result); |
806 | } | 807 | } |
@@ -830,10 +831,8 @@ static void nvme_process_cq(struct nvme_queue *nvmeq) | |||
830 | consumed++; | 831 | consumed++; |
831 | } | 832 | } |
832 | 833 | ||
833 | if (consumed) { | 834 | if (consumed) |
834 | nvme_ring_cq_doorbell(nvmeq); | 835 | nvme_ring_cq_doorbell(nvmeq); |
835 | nvmeq->cqe_seen = 1; | ||
836 | } | ||
837 | } | 836 | } |
838 | 837 | ||
839 | static irqreturn_t nvme_irq(int irq, void *data) | 838 | static irqreturn_t nvme_irq(int irq, void *data) |
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 2d7a98ab53fb..a53bb6635b83 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c | |||
@@ -199,12 +199,6 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req) | |||
199 | copy_and_pad(id->mn, sizeof(id->mn), model, sizeof(model) - 1); | 199 | copy_and_pad(id->mn, sizeof(id->mn), model, sizeof(model) - 1); |
200 | copy_and_pad(id->fr, sizeof(id->fr), UTS_RELEASE, strlen(UTS_RELEASE)); | 200 | copy_and_pad(id->fr, sizeof(id->fr), UTS_RELEASE, strlen(UTS_RELEASE)); |
201 | 201 | ||
202 | memset(id->mn, ' ', sizeof(id->mn)); | ||
203 | strncpy((char *)id->mn, "Linux", sizeof(id->mn)); | ||
204 | |||
205 | memset(id->fr, ' ', sizeof(id->fr)); | ||
206 | strncpy((char *)id->fr, UTS_RELEASE, sizeof(id->fr)); | ||
207 | |||
208 | id->rab = 6; | 202 | id->rab = 6; |
209 | 203 | ||
210 | /* | 204 | /* |
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 1b7f2520a20d..309c84aa7595 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c | |||
@@ -394,7 +394,7 @@ nvmet_fc_free_ls_iodlist(struct nvmet_fc_tgtport *tgtport) | |||
394 | static struct nvmet_fc_ls_iod * | 394 | static struct nvmet_fc_ls_iod * |
395 | nvmet_fc_alloc_ls_iod(struct nvmet_fc_tgtport *tgtport) | 395 | nvmet_fc_alloc_ls_iod(struct nvmet_fc_tgtport *tgtport) |
396 | { | 396 | { |
397 | static struct nvmet_fc_ls_iod *iod; | 397 | struct nvmet_fc_ls_iod *iod; |
398 | unsigned long flags; | 398 | unsigned long flags; |
399 | 399 | ||
400 | spin_lock_irqsave(&tgtport->lock, flags); | 400 | spin_lock_irqsave(&tgtport->lock, flags); |
@@ -471,7 +471,7 @@ nvmet_fc_destroy_fcp_iodlist(struct nvmet_fc_tgtport *tgtport, | |||
471 | static struct nvmet_fc_fcp_iod * | 471 | static struct nvmet_fc_fcp_iod * |
472 | nvmet_fc_alloc_fcp_iod(struct nvmet_fc_tgt_queue *queue) | 472 | nvmet_fc_alloc_fcp_iod(struct nvmet_fc_tgt_queue *queue) |
473 | { | 473 | { |
474 | static struct nvmet_fc_fcp_iod *fod; | 474 | struct nvmet_fc_fcp_iod *fod; |
475 | 475 | ||
476 | lockdep_assert_held(&queue->qlock); | 476 | lockdep_assert_held(&queue->qlock); |
477 | 477 | ||
@@ -704,7 +704,7 @@ nvmet_fc_delete_target_queue(struct nvmet_fc_tgt_queue *queue) | |||
704 | { | 704 | { |
705 | struct nvmet_fc_tgtport *tgtport = queue->assoc->tgtport; | 705 | struct nvmet_fc_tgtport *tgtport = queue->assoc->tgtport; |
706 | struct nvmet_fc_fcp_iod *fod = queue->fod; | 706 | struct nvmet_fc_fcp_iod *fod = queue->fod; |
707 | struct nvmet_fc_defer_fcp_req *deferfcp; | 707 | struct nvmet_fc_defer_fcp_req *deferfcp, *tempptr; |
708 | unsigned long flags; | 708 | unsigned long flags; |
709 | int i, writedataactive; | 709 | int i, writedataactive; |
710 | bool disconnect; | 710 | bool disconnect; |
@@ -735,7 +735,8 @@ nvmet_fc_delete_target_queue(struct nvmet_fc_tgt_queue *queue) | |||
735 | } | 735 | } |
736 | 736 | ||
737 | /* Cleanup defer'ed IOs in queue */ | 737 | /* Cleanup defer'ed IOs in queue */ |
738 | list_for_each_entry(deferfcp, &queue->avail_defer_list, req_list) { | 738 | list_for_each_entry_safe(deferfcp, tempptr, &queue->avail_defer_list, |
739 | req_list) { | ||
739 | list_del(&deferfcp->req_list); | 740 | list_del(&deferfcp->req_list); |
740 | kfree(deferfcp); | 741 | kfree(deferfcp); |
741 | } | 742 | } |
diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c index 4da69dbf7dca..1bdd02a6d6ac 100644 --- a/drivers/xen/biomerge.c +++ b/drivers/xen/biomerge.c | |||
@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, | |||
10 | unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); | 10 | unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); |
11 | unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); | 11 | unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); |
12 | 12 | ||
13 | return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && | 13 | return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; |
14 | ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); | ||
15 | #else | 14 | #else |
16 | /* | 15 | /* |
17 | * XXX: Add support for merging bio_vec when using different page | 16 | * XXX: Add support for merging bio_vec when using different page |