aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-12 14:35:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-12 14:35:19 -0400
commitb85dfd30cb37318587018ee430c2c1cfabf3dabc (patch)
treec4e1f65ff2d266913fd6fe9fc2e10138aac1aac5
parent7b565d9d1f9bfa16db5f78e4f547ce4bb1ecbdce (diff)
parentb6f2098fb708ce935a59763178c4e8cd942fcf88 (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe: "Remember about a week ago when I sent the last pull request for 4.1? Well, I lied. Now, I don't want to shift the blame, but Dan, Ming, and Richard made a liar out of me. Here are three small patches that should go into 4.1. More specifically, this pull request contains: - A Kconfig dependency for the pmem block driver, so it can't be selected if HAS_IOMEM isn't availble. From Richard Weinberger. - A fix for genhd, making the ext_devt_lock softirq safe. This makes lockdep happier, since we also end up grabbing this lock on release off the softirq path. From Dan Williams. - A blk-mq software queue release fix from Ming Lei. Last two are headed to stable, first fixes an issue introduced in this cycle" * 'for-linus' of git://git.kernel.dk/linux-block: block: pmem: Add dependency on HAS_IOMEM block: fix ext_dev_lock lockdep report blk-mq: free hctx->ctxs in queue's release handler
-rw-r--r--block/blk-mq.c8
-rw-r--r--block/genhd.c12
-rw-r--r--drivers/block/Kconfig1
3 files changed, 13 insertions, 8 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index e68b71b85a7e..594eea04266e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1600,6 +1600,7 @@ static int blk_mq_hctx_notify(void *data, unsigned long action,
1600 return NOTIFY_OK; 1600 return NOTIFY_OK;
1601} 1601}
1602 1602
1603/* hctx->ctxs will be freed in queue's release handler */
1603static void blk_mq_exit_hctx(struct request_queue *q, 1604static void blk_mq_exit_hctx(struct request_queue *q,
1604 struct blk_mq_tag_set *set, 1605 struct blk_mq_tag_set *set,
1605 struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx) 1606 struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
@@ -1618,7 +1619,6 @@ static void blk_mq_exit_hctx(struct request_queue *q,
1618 1619
1619 blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier); 1620 blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
1620 blk_free_flush_queue(hctx->fq); 1621 blk_free_flush_queue(hctx->fq);
1621 kfree(hctx->ctxs);
1622 blk_mq_free_bitmap(&hctx->ctx_map); 1622 blk_mq_free_bitmap(&hctx->ctx_map);
1623} 1623}
1624 1624
@@ -1891,8 +1891,12 @@ void blk_mq_release(struct request_queue *q)
1891 unsigned int i; 1891 unsigned int i;
1892 1892
1893 /* hctx kobj stays in hctx */ 1893 /* hctx kobj stays in hctx */
1894 queue_for_each_hw_ctx(q, hctx, i) 1894 queue_for_each_hw_ctx(q, hctx, i) {
1895 if (!hctx)
1896 continue;
1897 kfree(hctx->ctxs);
1895 kfree(hctx); 1898 kfree(hctx);
1899 }
1896 1900
1897 kfree(q->queue_hw_ctx); 1901 kfree(q->queue_hw_ctx);
1898 1902
diff --git a/block/genhd.c b/block/genhd.c
index 666e11b83983..ea982eadaf63 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -422,9 +422,9 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
422 /* allocate ext devt */ 422 /* allocate ext devt */
423 idr_preload(GFP_KERNEL); 423 idr_preload(GFP_KERNEL);
424 424
425 spin_lock(&ext_devt_lock); 425 spin_lock_bh(&ext_devt_lock);
426 idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT); 426 idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT);
427 spin_unlock(&ext_devt_lock); 427 spin_unlock_bh(&ext_devt_lock);
428 428
429 idr_preload_end(); 429 idr_preload_end();
430 if (idx < 0) 430 if (idx < 0)
@@ -449,9 +449,9 @@ void blk_free_devt(dev_t devt)
449 return; 449 return;
450 450
451 if (MAJOR(devt) == BLOCK_EXT_MAJOR) { 451 if (MAJOR(devt) == BLOCK_EXT_MAJOR) {
452 spin_lock(&ext_devt_lock); 452 spin_lock_bh(&ext_devt_lock);
453 idr_remove(&ext_devt_idr, blk_mangle_minor(MINOR(devt))); 453 idr_remove(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
454 spin_unlock(&ext_devt_lock); 454 spin_unlock_bh(&ext_devt_lock);
455 } 455 }
456} 456}
457 457
@@ -690,13 +690,13 @@ struct gendisk *get_gendisk(dev_t devt, int *partno)
690 } else { 690 } else {
691 struct hd_struct *part; 691 struct hd_struct *part;
692 692
693 spin_lock(&ext_devt_lock); 693 spin_lock_bh(&ext_devt_lock);
694 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt))); 694 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
695 if (part && get_disk(part_to_disk(part))) { 695 if (part && get_disk(part_to_disk(part))) {
696 *partno = part->partno; 696 *partno = part->partno;
697 disk = part_to_disk(part); 697 disk = part_to_disk(part);
698 } 698 }
699 spin_unlock(&ext_devt_lock); 699 spin_unlock_bh(&ext_devt_lock);
700 } 700 }
701 701
702 return disk; 702 return disk;
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index eb1fed5bd516..3ccef9eba6f9 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -406,6 +406,7 @@ config BLK_DEV_RAM_DAX
406 406
407config BLK_DEV_PMEM 407config BLK_DEV_PMEM
408 tristate "Persistent memory block device support" 408 tristate "Persistent memory block device support"
409 depends on HAS_IOMEM
409 help 410 help
410 Saying Y here will allow you to use a contiguous range of reserved 411 Saying Y here will allow you to use a contiguous range of reserved
411 memory as one or more persistent block devices. 412 memory as one or more persistent block devices.