Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-20180504' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
"A collection of fixes that should to into this release. This contains:

- Set of bcache fixes from Coly, fixing regression in patches that
went into this series.

- Set of NVMe fixes by way of Keith.

- Set of bdi related fixes, one from Jan and two from Tetsuo Handa,
fixing various issues around device addition/removal.

- Two block inflight fixes from Omar, fixing issues around the
transition to using tags for blk-mq inflight accounting that we
did a few releases ago"

* tag 'for-linus-20180504' of git://git.kernel.dk/linux-block:
bdi: Fix oops in wb_workfn()
nvmet: switch loopback target state to connecting when resetting
nvme/multipath: Fix multipath disabled naming collisions
nvme/multipath: Disable runtime writable enabling parameter
nvme: Set integrity flag for user passthrough commands
nvme: fix potential memory leak in option parsing
bdi: Fix use after free bug in debugfs_remove()
bdi: wake up concurrent wb_shutdown() callers.
bcache: use pr_info() to inform duplicated CACHE_SET_IO_DISABLE set
bcache: set dc->io_disable to true in conditional_stop_bcache_device()
bcache: add wait_for_kthread_stop() in bch_allocator_thread()
bcache: count backing device I/O error for writeback I/O
bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()
bcache: store disk name in struct cache and struct cached_dev
blk-mq: fix sysfs inflight counter
blk-mq: count allocated but not started requests in iostats inflight

+189 -82
+28 -12
block/blk-mq.c
··· 95 95 { 96 96 struct mq_inflight *mi = priv; 97 97 98 - if (blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) { 99 - /* 100 - * index[0] counts the specific partition that was asked 101 - * for. index[1] counts the ones that are active on the 102 - * whole device, so increment that if mi->part is indeed 103 - * a partition, and not a whole device. 104 - */ 105 - if (rq->part == mi->part) 106 - mi->inflight[0]++; 107 - if (mi->part->partno) 108 - mi->inflight[1]++; 109 - } 98 + /* 99 + * index[0] counts the specific partition that was asked for. index[1] 100 + * counts the ones that are active on the whole device, so increment 101 + * that if mi->part is indeed a partition, and not a whole device. 102 + */ 103 + if (rq->part == mi->part) 104 + mi->inflight[0]++; 105 + if (mi->part->partno) 106 + mi->inflight[1]++; 110 107 } 111 108 112 109 void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, ··· 113 116 114 117 inflight[0] = inflight[1] = 0; 115 118 blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi); 119 + } 120 + 121 + static void blk_mq_check_inflight_rw(struct blk_mq_hw_ctx *hctx, 122 + struct request *rq, void *priv, 123 + bool reserved) 124 + { 125 + struct mq_inflight *mi = priv; 126 + 127 + if (rq->part == mi->part) 128 + mi->inflight[rq_data_dir(rq)]++; 129 + } 130 + 131 + void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part, 132 + unsigned int inflight[2]) 133 + { 134 + struct mq_inflight mi = { .part = part, .inflight = inflight, }; 135 + 136 + inflight[0] = inflight[1] = 0; 137 + blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight_rw, &mi); 116 138 } 117 139 118 140 void blk_freeze_queue_start(struct request_queue *q)
+3 -1
block/blk-mq.h
··· 188 188 } 189 189 190 190 void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, 191 - unsigned int inflight[2]); 191 + unsigned int inflight[2]); 192 + void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part, 193 + unsigned int inflight[2]); 192 194 193 195 static inline void blk_mq_put_dispatch_budget(struct blk_mq_hw_ctx *hctx) 194 196 {
+12
block/genhd.c
··· 82 82 } 83 83 } 84 84 85 + void part_in_flight_rw(struct request_queue *q, struct hd_struct *part, 86 + unsigned int inflight[2]) 87 + { 88 + if (q->mq_ops) { 89 + blk_mq_in_flight_rw(q, part, inflight); 90 + return; 91 + } 92 + 93 + inflight[0] = atomic_read(&part->in_flight[0]); 94 + inflight[1] = atomic_read(&part->in_flight[1]); 95 + } 96 + 85 97 struct hd_struct *__disk_get_part(struct gendisk *disk, int partno) 86 98 { 87 99 struct disk_part_tbl *ptbl = rcu_dereference(disk->part_tbl);
+6 -4
block/partition-generic.c
··· 145 145 jiffies_to_msecs(part_stat_read(p, time_in_queue))); 146 146 } 147 147 148 - ssize_t part_inflight_show(struct device *dev, 149 - struct device_attribute *attr, char *buf) 148 + ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr, 149 + char *buf) 150 150 { 151 151 struct hd_struct *p = dev_to_part(dev); 152 + struct request_queue *q = part_to_disk(p)->queue; 153 + unsigned int inflight[2]; 152 154 153 - return sprintf(buf, "%8u %8u\n", atomic_read(&p->in_flight[0]), 154 - atomic_read(&p->in_flight[1])); 155 + part_in_flight_rw(q, p, inflight); 156 + return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]); 155 157 } 156 158 157 159 #ifdef CONFIG_FAIL_MAKE_REQUEST
+4 -1
drivers/md/bcache/alloc.c
··· 290 290 if (kthread_should_stop() || \ 291 291 test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \ 292 292 set_current_state(TASK_RUNNING); \ 293 - return 0; \ 293 + goto out; \ 294 294 } \ 295 295 \ 296 296 schedule(); \ ··· 378 378 bch_prio_write(ca); 379 379 } 380 380 } 381 + out: 382 + wait_for_kthread_stop(); 383 + return 0; 381 384 } 382 385 383 386 /* Allocation */
+4
drivers/md/bcache/bcache.h
··· 392 392 #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64 393 393 atomic_t io_errors; 394 394 unsigned error_limit; 395 + 396 + char backing_dev_name[BDEVNAME_SIZE]; 395 397 }; 396 398 397 399 enum alloc_reserve { ··· 466 464 atomic_long_t meta_sectors_written; 467 465 atomic_long_t btree_sectors_written; 468 466 atomic_long_t sectors_written; 467 + 468 + char cache_dev_name[BDEVNAME_SIZE]; 469 469 }; 470 470 471 471 struct gc_stat {
+1 -2
drivers/md/bcache/debug.c
··· 106 106 107 107 void bch_data_verify(struct cached_dev *dc, struct bio *bio) 108 108 { 109 - char name[BDEVNAME_SIZE]; 110 109 struct bio *check; 111 110 struct bio_vec bv, cbv; 112 111 struct bvec_iter iter, citer = { 0 }; ··· 133 134 bv.bv_len), 134 135 dc->disk.c, 135 136 "verify failed at dev %s sector %llu", 136 - bdevname(dc->bdev, name), 137 + dc->backing_dev_name, 137 138 (uint64_t) bio->bi_iter.bi_sector); 138 139 139 140 kunmap_atomic(p1);
+3 -5
drivers/md/bcache/io.c
··· 52 52 /* IO errors */ 53 53 void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) 54 54 { 55 - char buf[BDEVNAME_SIZE]; 56 55 unsigned errors; 57 56 58 57 WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); ··· 59 60 errors = atomic_add_return(1, &dc->io_errors); 60 61 if (errors < dc->error_limit) 61 62 pr_err("%s: IO error on backing device, unrecoverable", 62 - bio_devname(bio, buf)); 63 + dc->backing_dev_name); 63 64 else 64 65 bch_cached_dev_error(dc); 65 66 } ··· 104 105 } 105 106 106 107 if (error) { 107 - char buf[BDEVNAME_SIZE]; 108 108 unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, 109 109 &ca->io_errors); 110 110 errors >>= IO_ERROR_SHIFT; 111 111 112 112 if (errors < ca->set->error_limit) 113 113 pr_err("%s: IO error on %s%s", 114 - bdevname(ca->bdev, buf), m, 114 + ca->cache_dev_name, m, 115 115 is_read ? ", recovering." : "."); 116 116 else 117 117 bch_cache_set_error(ca->set, 118 118 "%s: too many IO errors %s", 119 - bdevname(ca->bdev, buf), m); 119 + ca->cache_dev_name, m); 120 120 } 121 121 } 122 122
+1 -4
drivers/md/bcache/request.c
··· 649 649 */ 650 650 if (unlikely(s->iop.writeback && 651 651 bio->bi_opf & REQ_PREFLUSH)) { 652 - char buf[BDEVNAME_SIZE]; 653 - 654 - bio_devname(bio, buf); 655 652 pr_err("Can't flush %s: returned bi_status %i", 656 - buf, bio->bi_status); 653 + dc->backing_dev_name, bio->bi_status); 657 654 } else { 658 655 /* set to orig_bio->bi_status in bio_complete() */ 659 656 s->iop.status = bio->bi_status;
+52 -23
drivers/md/bcache/super.c
··· 936 936 static void cached_dev_detach_finish(struct work_struct *w) 937 937 { 938 938 struct cached_dev *dc = container_of(w, struct cached_dev, detach); 939 - char buf[BDEVNAME_SIZE]; 940 939 struct closure cl; 941 940 closure_init_stack(&cl); 942 941 ··· 966 967 967 968 mutex_unlock(&bch_register_lock); 968 969 969 - pr_info("Caching disabled for %s", bdevname(dc->bdev, buf)); 970 + pr_info("Caching disabled for %s", dc->backing_dev_name); 970 971 971 972 /* Drop ref we took in cached_dev_detach() */ 972 973 closure_put(&dc->disk.cl); ··· 998 999 { 999 1000 uint32_t rtime = cpu_to_le32(get_seconds()); 1000 1001 struct uuid_entry *u; 1001 - char buf[BDEVNAME_SIZE]; 1002 1002 struct cached_dev *exist_dc, *t; 1003 - 1004 - bdevname(dc->bdev, buf); 1005 1003 1006 1004 if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) || 1007 1005 (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16))) 1008 1006 return -ENOENT; 1009 1007 1010 1008 if (dc->disk.c) { 1011 - pr_err("Can't attach %s: already attached", buf); 1009 + pr_err("Can't attach %s: already attached", 1010 + dc->backing_dev_name); 1012 1011 return -EINVAL; 1013 1012 } 1014 1013 1015 1014 if (test_bit(CACHE_SET_STOPPING, &c->flags)) { 1016 - pr_err("Can't attach %s: shutting down", buf); 1015 + pr_err("Can't attach %s: shutting down", 1016 + dc->backing_dev_name); 1017 1017 return -EINVAL; 1018 1018 } 1019 1019 1020 1020 if (dc->sb.block_size < c->sb.block_size) { 1021 1021 /* Will die */ 1022 1022 pr_err("Couldn't attach %s: block size less than set's block size", 1023 - buf); 1023 + dc->backing_dev_name); 1024 1024 return -EINVAL; 1025 1025 } 1026 1026 ··· 1027 1029 list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) { 1028 1030 if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) { 1029 1031 pr_err("Tried to attach %s but duplicate UUID already attached", 1030 - buf); 1032 + dc->backing_dev_name); 1031 1033 1032 1034 return -EINVAL; 1033 1035 } ··· 1045 1047 1046 1048 if (!u) { 1047 1049 if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { 1048 - pr_err("Couldn't find uuid for %s in set", buf); 1050 + pr_err("Couldn't find uuid for %s in set", 1051 + dc->backing_dev_name); 1049 1052 return -ENOENT; 1050 1053 } 1051 1054 1052 1055 u = uuid_find_empty(c); 1053 1056 if (!u) { 1054 - pr_err("Not caching %s, no room for UUID", buf); 1057 + pr_err("Not caching %s, no room for UUID", 1058 + dc->backing_dev_name); 1055 1059 return -EINVAL; 1056 1060 } 1057 1061 } ··· 1112 1112 up_write(&dc->writeback_lock); 1113 1113 1114 1114 pr_info("Caching %s as %s on set %pU", 1115 - bdevname(dc->bdev, buf), dc->disk.disk->disk_name, 1115 + dc->backing_dev_name, 1116 + dc->disk.disk->disk_name, 1116 1117 dc->disk.c->sb.set_uuid); 1117 1118 return 0; 1118 1119 } ··· 1226 1225 struct block_device *bdev, 1227 1226 struct cached_dev *dc) 1228 1227 { 1229 - char name[BDEVNAME_SIZE]; 1230 1228 const char *err = "cannot allocate memory"; 1231 1229 struct cache_set *c; 1232 1230 1231 + bdevname(bdev, dc->backing_dev_name); 1233 1232 memcpy(&dc->sb, sb, sizeof(struct cache_sb)); 1234 1233 dc->bdev = bdev; 1235 1234 dc->bdev->bd_holder = dc; ··· 1237 1236 bio_init(&dc->sb_bio, dc->sb_bio.bi_inline_vecs, 1); 1238 1237 bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page; 1239 1238 get_page(sb_page); 1239 + 1240 1240 1241 1241 if (cached_dev_init(dc, sb->block_size << 9)) 1242 1242 goto err; ··· 1249 1247 if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) 1250 1248 goto err; 1251 1249 1252 - pr_info("registered backing device %s", bdevname(bdev, name)); 1250 + pr_info("registered backing device %s", dc->backing_dev_name); 1253 1251 1254 1252 list_add(&dc->list, &uncached_devices); 1255 1253 list_for_each_entry(c, &bch_cache_sets, list) ··· 1261 1259 1262 1260 return; 1263 1261 err: 1264 - pr_notice("error %s: %s", bdevname(bdev, name), err); 1262 + pr_notice("error %s: %s", dc->backing_dev_name, err); 1265 1263 bcache_device_stop(&dc->disk); 1266 1264 } 1267 1265 ··· 1369 1367 1370 1368 bool bch_cached_dev_error(struct cached_dev *dc) 1371 1369 { 1372 - char name[BDEVNAME_SIZE]; 1370 + struct cache_set *c; 1373 1371 1374 1372 if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) 1375 1373 return false; ··· 1379 1377 smp_mb(); 1380 1378 1381 1379 pr_err("stop %s: too many IO errors on backing device %s\n", 1382 - dc->disk.disk->disk_name, bdevname(dc->bdev, name)); 1380 + dc->disk.disk->disk_name, dc->backing_dev_name); 1381 + 1382 + /* 1383 + * If the cached device is still attached to a cache set, 1384 + * even dc->io_disable is true and no more I/O requests 1385 + * accepted, cache device internal I/O (writeback scan or 1386 + * garbage collection) may still prevent bcache device from 1387 + * being stopped. So here CACHE_SET_IO_DISABLE should be 1388 + * set to c->flags too, to make the internal I/O to cache 1389 + * device rejected and stopped immediately. 1390 + * If c is NULL, that means the bcache device is not attached 1391 + * to any cache set, then no CACHE_SET_IO_DISABLE bit to set. 1392 + */ 1393 + c = dc->disk.c; 1394 + if (c && test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) 1395 + pr_info("CACHE_SET_IO_DISABLE already set"); 1383 1396 1384 1397 bcache_device_stop(&dc->disk); 1385 1398 return true; ··· 1412 1395 return false; 1413 1396 1414 1397 if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) 1415 - pr_warn("CACHE_SET_IO_DISABLE already set"); 1398 + pr_info("CACHE_SET_IO_DISABLE already set"); 1416 1399 1417 1400 /* XXX: we can be called from atomic context 1418 1401 acquire_console_sem(); ··· 1556 1539 */ 1557 1540 pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.", 1558 1541 d->disk->disk_name); 1542 + /* 1543 + * There might be a small time gap that cache set is 1544 + * released but bcache device is not. Inside this time 1545 + * gap, regular I/O requests will directly go into 1546 + * backing device as no cache set attached to. This 1547 + * behavior may also introduce potential inconsistence 1548 + * data in writeback mode while cache is dirty. 1549 + * Therefore before calling bcache_device_stop() due 1550 + * to a broken cache device, dc->io_disable should be 1551 + * explicitly set to true. 1552 + */ 1553 + dc->io_disable = true; 1554 + /* make others know io_disable is true earlier */ 1555 + smp_mb(); 1559 1556 bcache_device_stop(d); 1560 1557 } else { 1561 1558 /* ··· 2034 2003 static int register_cache(struct cache_sb *sb, struct page *sb_page, 2035 2004 struct block_device *bdev, struct cache *ca) 2036 2005 { 2037 - char name[BDEVNAME_SIZE]; 2038 2006 const char *err = NULL; /* must be set for any error case */ 2039 2007 int ret = 0; 2040 2008 2041 - bdevname(bdev, name); 2042 - 2009 + bdevname(bdev, ca->cache_dev_name); 2043 2010 memcpy(&ca->sb, sb, sizeof(struct cache_sb)); 2044 2011 ca->bdev = bdev; 2045 2012 ca->bdev->bd_holder = ca; ··· 2074 2045 goto out; 2075 2046 } 2076 2047 2077 - pr_info("registered cache device %s", name); 2048 + pr_info("registered cache device %s", ca->cache_dev_name); 2078 2049 2079 2050 out: 2080 2051 kobject_put(&ca->kobj); 2081 2052 2082 2053 err: 2083 2054 if (err) 2084 - pr_notice("error %s: %s", name, err); 2055 + pr_notice("error %s: %s", ca->cache_dev_name, err); 2085 2056 2086 2057 return ret; 2087 2058 }
+3 -1
drivers/md/bcache/writeback.c
··· 244 244 struct keybuf_key *w = bio->bi_private; 245 245 struct dirty_io *io = w->private; 246 246 247 - if (bio->bi_status) 247 + if (bio->bi_status) { 248 248 SET_KEY_DIRTY(&w->key, false); 249 + bch_count_backing_io_errors(io->dc, bio); 250 + } 249 251 250 252 closure_put(&io->cl); 251 253 }
+2 -25
drivers/nvme/host/core.c
··· 764 764 ret = PTR_ERR(meta); 765 765 goto out_unmap; 766 766 } 767 + req->cmd_flags |= REQ_INTEGRITY; 767 768 } 768 769 } 769 770 ··· 2998 2997 if (nvme_init_ns_head(ns, nsid, id)) 2999 2998 goto out_free_id; 3000 2999 nvme_setup_streams_ns(ctrl, ns); 3001 - 3002 - #ifdef CONFIG_NVME_MULTIPATH 3003 - /* 3004 - * If multipathing is enabled we need to always use the subsystem 3005 - * instance number for numbering our devices to avoid conflicts 3006 - * between subsystems that have multiple controllers and thus use 3007 - * the multipath-aware subsystem node and those that have a single 3008 - * controller and use the controller node directly. 3009 - */ 3010 - if (ns->head->disk) { 3011 - sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, 3012 - ctrl->cntlid, ns->head->instance); 3013 - flags = GENHD_FL_HIDDEN; 3014 - } else { 3015 - sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, 3016 - ns->head->instance); 3017 - } 3018 - #else 3019 - /* 3020 - * But without the multipath code enabled, multiple controller per 3021 - * subsystems are visible as devices and thus we cannot use the 3022 - * subsystem instance. 3023 - */ 3024 - sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); 3025 - #endif 3000 + nvme_set_disk_name(disk_name, ns, ctrl, &flags); 3026 3001 3027 3002 if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) { 3028 3003 if (nvme_nvm_register(ns, disk_name, node)) {
+6
drivers/nvme/host/fabrics.c
··· 668 668 ret = -ENOMEM; 669 669 goto out; 670 670 } 671 + kfree(opts->transport); 671 672 opts->transport = p; 672 673 break; 673 674 case NVMF_OPT_NQN: ··· 677 676 ret = -ENOMEM; 678 677 goto out; 679 678 } 679 + kfree(opts->subsysnqn); 680 680 opts->subsysnqn = p; 681 681 nqnlen = strlen(opts->subsysnqn); 682 682 if (nqnlen >= NVMF_NQN_SIZE) { ··· 700 698 ret = -ENOMEM; 701 699 goto out; 702 700 } 701 + kfree(opts->traddr); 703 702 opts->traddr = p; 704 703 break; 705 704 case NVMF_OPT_TRSVCID: ··· 709 706 ret = -ENOMEM; 710 707 goto out; 711 708 } 709 + kfree(opts->trsvcid); 712 710 opts->trsvcid = p; 713 711 break; 714 712 case NVMF_OPT_QUEUE_SIZE: ··· 796 792 ret = -EINVAL; 797 793 goto out; 798 794 } 795 + nvmf_host_put(opts->host); 799 796 opts->host = nvmf_host_add(p); 800 797 kfree(p); 801 798 if (!opts->host) { ··· 822 817 ret = -ENOMEM; 823 818 goto out; 824 819 } 820 + kfree(opts->host_traddr); 825 821 opts->host_traddr = p; 826 822 break; 827 823 case NVMF_OPT_HOST_ID:
+23 -1
drivers/nvme/host/multipath.c
··· 15 15 #include "nvme.h" 16 16 17 17 static bool multipath = true; 18 - module_param(multipath, bool, 0644); 18 + module_param(multipath, bool, 0444); 19 19 MODULE_PARM_DESC(multipath, 20 20 "turn on native support for multiple controllers per subsystem"); 21 + 22 + /* 23 + * If multipathing is enabled we need to always use the subsystem instance 24 + * number for numbering our devices to avoid conflicts between subsystems that 25 + * have multiple controllers and thus use the multipath-aware subsystem node 26 + * and those that have a single controller and use the controller node 27 + * directly. 28 + */ 29 + void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, 30 + struct nvme_ctrl *ctrl, int *flags) 31 + { 32 + if (!multipath) { 33 + sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); 34 + } else if (ns->head->disk) { 35 + sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, 36 + ctrl->cntlid, ns->head->instance); 37 + *flags = GENHD_FL_HIDDEN; 38 + } else { 39 + sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, 40 + ns->head->instance); 41 + } 42 + } 21 43 22 44 void nvme_failover_req(struct request *req) 23 45 {
+12
drivers/nvme/host/nvme.h
··· 436 436 extern const struct block_device_operations nvme_ns_head_ops; 437 437 438 438 #ifdef CONFIG_NVME_MULTIPATH 439 + void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, 440 + struct nvme_ctrl *ctrl, int *flags); 439 441 void nvme_failover_req(struct request *req); 440 442 bool nvme_req_needs_failover(struct request *req, blk_status_t error); 441 443 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); ··· 463 461 } 464 462 465 463 #else 464 + /* 465 + * Without the multipath code enabled, multiple controller per subsystems are 466 + * visible as devices and thus we cannot use the subsystem instance. 467 + */ 468 + static inline void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, 469 + struct nvme_ctrl *ctrl, int *flags) 470 + { 471 + sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); 472 + } 473 + 466 474 static inline void nvme_failover_req(struct request *req) 467 475 { 468 476 }
+6
drivers/nvme/target/loop.c
··· 469 469 nvme_stop_ctrl(&ctrl->ctrl); 470 470 nvme_loop_shutdown_ctrl(ctrl); 471 471 472 + if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { 473 + /* state change failure should never happen */ 474 + WARN_ON_ONCE(1); 475 + return; 476 + } 477 + 472 478 ret = nvme_loop_configure_admin_queue(ctrl); 473 479 if (ret) 474 480 goto out_disable;
+1 -1
fs/fs-writeback.c
··· 1961 1961 } 1962 1962 1963 1963 if (!list_empty(&wb->work_list)) 1964 - mod_delayed_work(bdi_wq, &wb->dwork, 0); 1964 + wb_wakeup(wb); 1965 1965 else if (wb_has_dirty_io(wb) && dirty_writeback_interval) 1966 1966 wb_wakeup_delayed(wb); 1967 1967
+3 -1
include/linux/genhd.h
··· 368 368 part_stat_add(cpu, gendiskp, field, -subnd) 369 369 370 370 void part_in_flight(struct request_queue *q, struct hd_struct *part, 371 - unsigned int inflight[2]); 371 + unsigned int inflight[2]); 372 + void part_in_flight_rw(struct request_queue *q, struct hd_struct *part, 373 + unsigned int inflight[2]); 372 374 void part_dec_in_flight(struct request_queue *q, struct hd_struct *part, 373 375 int rw); 374 376 void part_inc_in_flight(struct request_queue *q, struct hd_struct *part,
+17
include/linux/wait_bit.h
··· 305 305 __ret; \ 306 306 }) 307 307 308 + /** 309 + * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit 310 + * 311 + * @bit: the bit of the word being waited on 312 + * @word: the word being waited on, a kernel virtual address 313 + * 314 + * You can use this helper if bitflags are manipulated atomically rather than 315 + * non-atomically under a lock. 316 + */ 317 + static inline void clear_and_wake_up_bit(int bit, void *word) 318 + { 319 + clear_bit_unlock(bit, word); 320 + /* See wake_up_bit() for which memory barrier you need to use. */ 321 + smp_mb__after_atomic(); 322 + wake_up_bit(word, bit); 323 + } 324 + 308 325 #endif /* _LINUX_WAIT_BIT_H */
+2 -1
mm/backing-dev.c
··· 115 115 bdi, &bdi_debug_stats_fops); 116 116 if (!bdi->debug_stats) { 117 117 debugfs_remove(bdi->debug_dir); 118 + bdi->debug_dir = NULL; 118 119 return -ENOMEM; 119 120 } 120 121 ··· 384 383 * the barrier provided by test_and_clear_bit() above. 385 384 */ 386 385 smp_wmb(); 387 - clear_bit(WB_shutting_down, &wb->state); 386 + clear_and_wake_up_bit(WB_shutting_down, &wb->state); 388 387 } 389 388 390 389 static void wb_exit(struct bdi_writeback *wb)