diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-04-07 19:28:36 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-04-07 19:28:36 -0400 |
| commit | 429fba106e82e2792010a825b9dbeadd00bf9e9c (patch) | |
| tree | acaa2cefe9a35a7d25467957ea07f20eef63ecbc /drivers | |
| parent | 3b04689147085f5c8f47835d1c7e48203cba80d3 (diff) | |
| parent | 47b16820c490149c2923e8474048f2c6e7557cab (diff) | |
Merge tag 'for-linus-20190407' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
- Fixups for the pf/pcd queue handling (YueHaibing)
- Revert of the three direct issue changes as they have been proven to
cause an issue with dm-mpath (Bart)
- Plug rq_count reset fix (Dongli)
- io_uring double free in fileset registration error handling (me)
- Make null_blk handle bad numa node passed in (John)
- BFQ ifdef fix (Konstantin)
- Flush queue leak fix (Shenghui)
- Plug trace fix (Yufen)
* tag 'for-linus-20190407' of git://git.kernel.dk/linux-block:
xsysace: Fix error handling in ace_setup
null_blk: prevent crash from bad home_node value
block: Revert v5.0 blk_mq_request_issue_directly() changes
paride/pcd: Fix potential NULL pointer dereference and mem leak
blk-mq: do not reset plug->rq_count before the list is sorted
paride/pf: Fix potential NULL pointer dereference
io_uring: fix double free in case of fileset regitration failure
blk-mq: add trace block plug and unplug for multiple queues
block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
block/bfq: fix ifdef for CONFIG_BFQ_GROUP_IOSCHED=y
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/block/null_blk_main.c | 5 | ||||
| -rw-r--r-- | drivers/block/paride/pcd.c | 14 | ||||
| -rw-r--r-- | drivers/block/paride/pf.c | 12 | ||||
| -rw-r--r-- | drivers/block/xsysace.c | 2 |
4 files changed, 31 insertions, 2 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 417a9f15c116..d7ac09c092f2 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c | |||
| @@ -1748,6 +1748,11 @@ static int __init null_init(void) | |||
| 1748 | return -EINVAL; | 1748 | return -EINVAL; |
| 1749 | } | 1749 | } |
| 1750 | 1750 | ||
| 1751 | if (g_home_node != NUMA_NO_NODE && g_home_node >= nr_online_nodes) { | ||
| 1752 | pr_err("null_blk: invalid home_node value\n"); | ||
| 1753 | g_home_node = NUMA_NO_NODE; | ||
| 1754 | } | ||
| 1755 | |||
| 1751 | if (g_queue_mode == NULL_Q_RQ) { | 1756 | if (g_queue_mode == NULL_Q_RQ) { |
| 1752 | pr_err("null_blk: legacy IO path no longer available\n"); | 1757 | pr_err("null_blk: legacy IO path no longer available\n"); |
| 1753 | return -EINVAL; | 1758 | return -EINVAL; |
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 377a694dc228..6d415b20fb70 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c | |||
| @@ -314,6 +314,7 @@ static void pcd_init_units(void) | |||
| 314 | disk->queue = blk_mq_init_sq_queue(&cd->tag_set, &pcd_mq_ops, | 314 | disk->queue = blk_mq_init_sq_queue(&cd->tag_set, &pcd_mq_ops, |
| 315 | 1, BLK_MQ_F_SHOULD_MERGE); | 315 | 1, BLK_MQ_F_SHOULD_MERGE); |
| 316 | if (IS_ERR(disk->queue)) { | 316 | if (IS_ERR(disk->queue)) { |
| 317 | put_disk(disk); | ||
| 317 | disk->queue = NULL; | 318 | disk->queue = NULL; |
| 318 | continue; | 319 | continue; |
| 319 | } | 320 | } |
| @@ -750,6 +751,8 @@ static int pcd_detect(void) | |||
| 750 | 751 | ||
| 751 | printk("%s: No CD-ROM drive found\n", name); | 752 | printk("%s: No CD-ROM drive found\n", name); |
| 752 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { | 753 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { |
| 754 | if (!cd->disk) | ||
| 755 | continue; | ||
| 753 | blk_cleanup_queue(cd->disk->queue); | 756 | blk_cleanup_queue(cd->disk->queue); |
| 754 | cd->disk->queue = NULL; | 757 | cd->disk->queue = NULL; |
| 755 | blk_mq_free_tag_set(&cd->tag_set); | 758 | blk_mq_free_tag_set(&cd->tag_set); |
| @@ -1010,8 +1013,14 @@ static int __init pcd_init(void) | |||
| 1010 | pcd_probe_capabilities(); | 1013 | pcd_probe_capabilities(); |
| 1011 | 1014 | ||
| 1012 | if (register_blkdev(major, name)) { | 1015 | if (register_blkdev(major, name)) { |
| 1013 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) | 1016 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { |
| 1017 | if (!cd->disk) | ||
| 1018 | continue; | ||
| 1019 | |||
| 1020 | blk_cleanup_queue(cd->disk->queue); | ||
| 1021 | blk_mq_free_tag_set(&cd->tag_set); | ||
| 1014 | put_disk(cd->disk); | 1022 | put_disk(cd->disk); |
| 1023 | } | ||
| 1015 | return -EBUSY; | 1024 | return -EBUSY; |
| 1016 | } | 1025 | } |
| 1017 | 1026 | ||
| @@ -1032,6 +1041,9 @@ static void __exit pcd_exit(void) | |||
| 1032 | int unit; | 1041 | int unit; |
| 1033 | 1042 | ||
| 1034 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { | 1043 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { |
| 1044 | if (!cd->disk) | ||
| 1045 | continue; | ||
| 1046 | |||
| 1035 | if (cd->present) { | 1047 | if (cd->present) { |
| 1036 | del_gendisk(cd->disk); | 1048 | del_gendisk(cd->disk); |
| 1037 | pi_release(cd->pi); | 1049 | pi_release(cd->pi); |
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 103b617cdc31..35e6e271b219 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
| @@ -762,6 +762,8 @@ static int pf_detect(void) | |||
| 762 | 762 | ||
| 763 | printk("%s: No ATAPI disk detected\n", name); | 763 | printk("%s: No ATAPI disk detected\n", name); |
| 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { | 764 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 765 | if (!pf->disk) | ||
| 766 | continue; | ||
| 765 | blk_cleanup_queue(pf->disk->queue); | 767 | blk_cleanup_queue(pf->disk->queue); |
| 766 | pf->disk->queue = NULL; | 768 | pf->disk->queue = NULL; |
| 767 | blk_mq_free_tag_set(&pf->tag_set); | 769 | blk_mq_free_tag_set(&pf->tag_set); |
| @@ -1029,8 +1031,13 @@ static int __init pf_init(void) | |||
| 1029 | pf_busy = 0; | 1031 | pf_busy = 0; |
| 1030 | 1032 | ||
| 1031 | if (register_blkdev(major, name)) { | 1033 | if (register_blkdev(major, name)) { |
| 1032 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) | 1034 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 1035 | if (!pf->disk) | ||
| 1036 | continue; | ||
| 1037 | blk_cleanup_queue(pf->disk->queue); | ||
| 1038 | blk_mq_free_tag_set(&pf->tag_set); | ||
| 1033 | put_disk(pf->disk); | 1039 | put_disk(pf->disk); |
| 1040 | } | ||
| 1034 | return -EBUSY; | 1041 | return -EBUSY; |
| 1035 | } | 1042 | } |
| 1036 | 1043 | ||
| @@ -1051,6 +1058,9 @@ static void __exit pf_exit(void) | |||
| 1051 | int unit; | 1058 | int unit; |
| 1052 | unregister_blkdev(major, name); | 1059 | unregister_blkdev(major, name); |
| 1053 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { | 1060 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { |
| 1061 | if (!pf->disk) | ||
| 1062 | continue; | ||
| 1063 | |||
| 1054 | if (pf->present) | 1064 | if (pf->present) |
| 1055 | del_gendisk(pf->disk); | 1065 | del_gendisk(pf->disk); |
| 1056 | 1066 | ||
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 87ccef4bd69e..32a21b8d1d85 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
| @@ -1090,6 +1090,8 @@ static int ace_setup(struct ace_device *ace) | |||
| 1090 | return 0; | 1090 | return 0; |
| 1091 | 1091 | ||
| 1092 | err_read: | 1092 | err_read: |
| 1093 | /* prevent double queue cleanup */ | ||
| 1094 | ace->gd->queue = NULL; | ||
| 1093 | put_disk(ace->gd); | 1095 | put_disk(ace->gd); |
| 1094 | err_alloc_disk: | 1096 | err_alloc_disk: |
| 1095 | blk_cleanup_queue(ace->queue); | 1097 | blk_cleanup_queue(ace->queue); |
