History

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

Linus Torvalds committed 11 years ago

Commit b85dfd32 parents 7b565d9 b6f20983 files · +13 −8Browse files

Unified · Split

3 files
  1. block/blk-mq.c +6 −2
  2. block/genhd.c +6 −6
  3. drivers/block/Kconfig +1 −0
block/blk-mq.c+6−2
@@ -1600,6 +1600,7 @@ static int blk_mq_hctx_notify(void *data, unsigned long action, · 1599 unmodified lines
16001600 return NOTIFY_OK;
16011601 }
16021602
1603+/* hctx->ctxs will be freed in queue's release handler */
16031604 static void blk_mq_exit_hctx(struct request_queue *q,
16041605 struct blk_mq_tag_set *set,
16051606 struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
@@ -1618,7 +1619,6 @@ static void blk_mq_exit_hctx(struct request_queue *q, · 12 unmodified lines
16181619
16191620 blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
16201621 blk_free_flush_queue(hctx->fq);
1621− kfree(hctx->ctxs);
16221622 blk_mq_free_bitmap(&hctx->ctx_map);
16231623 }
16241624
@@ -1891,8 +1891,12 @@ void blk_mq_release(struct request_queue *q) · 266 unmodified lines
18911891 unsigned int i;
18921892
18931893 /* 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);
18951898 kfree(hctx);
1899+ }
18961900
18971901 kfree(q->queue_hw_ctx);
18981902
block/genhd.c+6−6
@@ -422,9 +422,9 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt) · 421 unmodified lines
422422 /* allocate ext devt */
423423 idr_preload(GFP_KERNEL);
424424
425− spin_lock(&ext_devt_lock);
425+ spin_lock_bh(&ext_devt_lock);
426426 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);
428428
429429 idr_preload_end();
430430 if (idx < 0)
@@ -449,9 +449,9 @@ void blk_free_devt(dev_t devt) · 18 unmodified lines
449449 return;
450450
451451 if (MAJOR(devt) == BLOCK_EXT_MAJOR) {
452− spin_lock(&ext_devt_lock);
452+ spin_lock_bh(&ext_devt_lock);
453453 idr_remove(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
454− spin_unlock(&ext_devt_lock);
454+ spin_unlock_bh(&ext_devt_lock);
455455 }
456456 }
457457
@@ -690,13 +690,13 @@ struct gendisk *get_gendisk(dev_t devt, int *partno) · 232 unmodified lines
690690 } else {
691691 struct hd_struct *part;
692692
693− spin_lock(&ext_devt_lock);
693+ spin_lock_bh(&ext_devt_lock);
694694 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
695695 if (part && get_disk(part_to_disk(part))) {
696696 *partno = part->partno;
697697 disk = part_to_disk(part);
698698 }
699− spin_unlock(&ext_devt_lock);
699+ spin_unlock_bh(&ext_devt_lock);
700700 }
701701
702702 return disk;
drivers/block/Kconfig+1−0
@@ -406,6 +406,7 @@ config BLK_DEV_RAM_DAX · 405 unmodified lines
406406
407407 config BLK_DEV_PMEM
408408 tristate "Persistent memory block device support"
409+ depends on HAS_IOMEM
409410 help
410411 Saying Y here will allow you to use a contiguous range of reserved
411412 memory as one or more persistent block devices.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t