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 'block-6.2-2023-01-20' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:
"Various little tweaks all over the place:

- NVMe pull request via Christoph:
- fix controller shutdown regression in nvme-apple (Janne Grunau)
- fix a polling on timeout regression in nvme-pci (Keith Busch)

- Fix a bug in the read request side request allocation caching
(Pavel)

- pktcdvd was brought back after we configured a NULL return on bio
splits, make it consistent with the others (me)

- BFQ refcount fix (Yu)

- Block cgroup policy activation fix (Yu)

- Fix for an md regression introduced in the 6.2 cycle (Adrian)"

* tag 'block-6.2-2023-01-20' of git://git.kernel.dk/linux:
nvme-pci: fix timeout request state check
nvme-apple: only reset the controller when RTKit is running
nvme-apple: reset controller during shutdown
block: fix hctx checks for batch allocation
block/rnbd-clt: fix wrong max ID in ida_alloc_max
blk-cgroup: fix missing pd_online_fn() while activating policy
pktcdvd: check for NULL returna fter calling bio_split_to_limits()
block, bfq: switch 'bfqg->ref' to use atomic refcount apis
md: fix incorrect declaration about claim_rdev in md_import_device

+39 -15
+3 -5
block/bfq-cgroup.c
··· 316 316 317 317 static void bfqg_get(struct bfq_group *bfqg) 318 318 { 319 - bfqg->ref++; 319 + refcount_inc(&bfqg->ref); 320 320 } 321 321 322 322 static void bfqg_put(struct bfq_group *bfqg) 323 323 { 324 - bfqg->ref--; 325 - 326 - if (bfqg->ref == 0) 324 + if (refcount_dec_and_test(&bfqg->ref)) 327 325 kfree(bfqg); 328 326 } 329 327 ··· 528 530 } 529 531 530 532 /* see comments in bfq_bic_update_cgroup for why refcounting */ 531 - bfqg_get(bfqg); 533 + refcount_set(&bfqg->ref, 1); 532 534 return &bfqg->pd; 533 535 } 534 536
+1 -1
block/bfq-iosched.h
··· 928 928 char blkg_path[128]; 929 929 930 930 /* reference counter (see comments in bfq_bic_update_cgroup) */ 931 - int ref; 931 + refcount_t ref; 932 932 /* Is bfq_group still online? */ 933 933 bool online; 934 934
+4
block/blk-cgroup.c
··· 1455 1455 list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) 1456 1456 pol->pd_init_fn(blkg->pd[pol->plid]); 1457 1457 1458 + if (pol->pd_online_fn) 1459 + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) 1460 + pol->pd_online_fn(blkg->pd[pol->plid]); 1461 + 1458 1462 __set_bit(pol->plid, q->blkcg_pols); 1459 1463 ret = 0; 1460 1464
+5 -1
block/blk-mq.c
··· 2890 2890 struct blk_plug *plug, struct bio **bio, unsigned int nsegs) 2891 2891 { 2892 2892 struct request *rq; 2893 + enum hctx_type type, hctx_type; 2893 2894 2894 2895 if (!plug) 2895 2896 return NULL; ··· 2903 2902 return NULL; 2904 2903 } 2905 2904 2906 - if (blk_mq_get_hctx_type((*bio)->bi_opf) != rq->mq_hctx->type) 2905 + type = blk_mq_get_hctx_type((*bio)->bi_opf); 2906 + hctx_type = rq->mq_hctx->type; 2907 + if (type != hctx_type && 2908 + !(type == HCTX_TYPE_READ && hctx_type == HCTX_TYPE_DEFAULT)) 2907 2909 return NULL; 2908 2910 if (op_is_flush(rq->cmd_flags) != op_is_flush((*bio)->bi_opf)) 2909 2911 return NULL;
+2
drivers/block/pktcdvd.c
··· 2400 2400 struct bio *split; 2401 2401 2402 2402 bio = bio_split_to_limits(bio); 2403 + if (!bio) 2404 + return; 2403 2405 2404 2406 pkt_dbg(2, pd, "start = %6llx stop = %6llx\n", 2405 2407 (unsigned long long)bio->bi_iter.bi_sector,
+1 -1
drivers/block/rnbd/rnbd-clt.c
··· 1440 1440 goto out_alloc; 1441 1441 } 1442 1442 1443 - ret = ida_alloc_max(&index_ida, 1 << (MINORBITS - RNBD_PART_BITS), 1443 + ret = ida_alloc_max(&index_ida, (1 << (MINORBITS - RNBD_PART_BITS)) - 1, 1444 1444 GFP_KERNEL); 1445 1445 if (ret < 0) { 1446 1446 pr_err("Failed to initialize device '%s' from session %s, allocating idr failed, err: %d\n",
+2 -2
drivers/md/md.c
··· 3644 3644 */ 3645 3645 static struct md_rdev *md_import_device(dev_t newdev, int super_format, int super_minor) 3646 3646 { 3647 - static struct md_rdev *claim_rdev; /* just for claiming the bdev */ 3647 + static struct md_rdev claim_rdev; /* just for claiming the bdev */ 3648 3648 struct md_rdev *rdev; 3649 3649 sector_t size; 3650 3650 int err; ··· 3662 3662 3663 3663 rdev->bdev = blkdev_get_by_dev(newdev, 3664 3664 FMODE_READ | FMODE_WRITE | FMODE_EXCL, 3665 - super_format == -2 ? claim_rdev : rdev); 3665 + super_format == -2 ? &claim_rdev : rdev); 3666 3666 if (IS_ERR(rdev->bdev)) { 3667 3667 pr_warn("md: could not open device unknown-block(%u,%u).\n", 3668 3668 MAJOR(newdev), MINOR(newdev));
+20 -4
drivers/nvme/host/apple.c
··· 829 829 apple_nvme_remove_cq(anv); 830 830 } 831 831 832 - nvme_disable_ctrl(&anv->ctrl, shutdown); 832 + /* 833 + * Always disable the NVMe controller after shutdown. 834 + * We need to do this to bring it back up later anyway, and we 835 + * can't do it while the firmware is not running (e.g. in the 836 + * resume reset path before RTKit is initialized), so for Apple 837 + * controllers it makes sense to unconditionally do it here. 838 + * Additionally, this sequence of events is reliable, while 839 + * others (like disabling after bringing back the firmware on 840 + * resume) seem to run into trouble under some circumstances. 841 + * 842 + * Both U-Boot and m1n1 also use this convention (i.e. an ANS 843 + * NVMe controller is handed off with firmware shut down, in an 844 + * NVMe disabled state, after a clean shutdown). 845 + */ 846 + if (shutdown) 847 + nvme_disable_ctrl(&anv->ctrl, shutdown); 848 + nvme_disable_ctrl(&anv->ctrl, false); 833 849 } 834 850 835 851 WRITE_ONCE(anv->ioq.enabled, false); ··· 1001 985 goto out; 1002 986 } 1003 987 1004 - if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) 1005 - apple_nvme_disable(anv, false); 1006 - 1007 988 /* RTKit must be shut down cleanly for the (soft)-reset to work */ 1008 989 if (apple_rtkit_is_running(anv->rtk)) { 990 + /* reset the controller if it is enabled */ 991 + if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) 992 + apple_nvme_disable(anv, false); 1009 993 dev_dbg(anv->dev, "Trying to shut down RTKit before reset."); 1010 994 ret = apple_rtkit_shutdown(anv->rtk); 1011 995 if (ret)
+1 -1
drivers/nvme/host/pci.c
··· 1362 1362 else 1363 1363 nvme_poll_irqdisable(nvmeq); 1364 1364 1365 - if (blk_mq_request_completed(req)) { 1365 + if (blk_mq_rq_state(req) != MQ_RQ_IN_FLIGHT) { 1366 1366 dev_warn(dev->ctrl.device, 1367 1367 "I/O %d QID %d timeout, completion polled\n", 1368 1368 req->tag, nvmeq->qid);