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.3-2023-03-16' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:
"A bit bigger than usual, as the NVMe pull request missed last weeks
submission. In detail:

- NVMe pull request via Christoph:
- Avoid potential UAF in nvmet_req_complete (Damien Le Moal)
- More quirks (Elmer Miroslav Mosher Golovin, Philipp Geulen)
- Fix a memory leak in the nvme-pci probe teardown path
(Irvin Cote)
- Repair the MAINTAINERS entry (Lukas Bulwahn)
- Fix handling single range discard request (Ming Lei)
- Show more opcode names in trace events (Minwoo Im)
- Fix nvme-tcp timeout reporting (Sagi Grimberg)

- MD pull request via Song:
- Two fixes for old issues (Neil)
- Resource leak in device stopping (Xiao)

- Bio based device stats fix (Yu)

- Kill unused CONFIG_BLOCK_COMPAT (Lukas)

- sunvdc missing mdesc_grab() failure check (Liang)

- Fix for reversal of request ordering upon issue for certain cases
(Jan)

- null_blk timeout fixes (Damien)

- Loop use-after-free fix (Bart)

- blk-mq SRCU fix for BLK_MQ_F_BLOCKING devices (Chris)"

* tag 'block-6.3-2023-03-16' of git://git.kernel.dk/linux:
block: remove obsolete config BLOCK_COMPAT
md: select BLOCK_LEGACY_AUTOLOAD
block: count 'ios' and 'sectors' when io is done for bio-based device
block: sunvdc: add check for mdesc_grab() returning NULL
nvmet: avoid potential UAF in nvmet_req_complete()
nvme-trace: show more opcode names
nvme-tcp: add nvme-tcp pdu size build protection
nvme-tcp: fix opcode reporting in the timeout handler
nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM620
nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV3000
nvme-pci: fixing memory leak in probe teardown path
nvme: fix handling single range discard request
MAINTAINERS: repair malformed T: entries in NVM EXPRESS DRIVERS
block: null_blk: cleanup null_queue_rq()
block: null_blk: Fix handling of fake timeout request
blk-mq: fix "bad unlock balance detected" on q->srcu in __blk_mq_run_dispatch_ops
loop: Fix use-after-free issues
block: do not reverse request order when flushing plug list
md: avoid signed overflow in slot_store()
md: Free resources in __md_stop

+135 -79
+4 -4
MAINTAINERS
··· 14872 14872 L: linux-nvme@lists.infradead.org 14873 14873 S: Supported 14874 14874 W: http://git.infradead.org/nvme.git 14875 - T: git://git.infradead.org/nvme.git 14875 + T: git git://git.infradead.org/nvme.git 14876 14876 F: Documentation/nvme/ 14877 - F: drivers/nvme/host/ 14878 14877 F: drivers/nvme/common/ 14879 - F: include/linux/nvme.h 14878 + F: drivers/nvme/host/ 14880 14879 F: include/linux/nvme-*.h 14880 + F: include/linux/nvme.h 14881 14881 F: include/uapi/linux/nvme_ioctl.h 14882 14882 14883 14883 NVM EXPRESS FABRICS AUTHENTICATION ··· 14912 14912 L: linux-nvme@lists.infradead.org 14913 14913 S: Supported 14914 14914 W: http://git.infradead.org/nvme.git 14915 - T: git://git.infradead.org/nvme.git 14915 + T: git git://git.infradead.org/nvme.git 14916 14916 F: drivers/nvme/target/ 14917 14917 14918 14918 NVMEM FRAMEWORK
-3
block/Kconfig
··· 204 204 205 205 source "block/partitions/Kconfig" 206 206 207 - config BLOCK_COMPAT 208 - def_bool COMPAT 209 - 210 207 config BLK_MQ_PCI 211 208 def_bool PCI 212 209
+6 -10
block/blk-core.c
··· 959 959 } 960 960 } 961 961 962 - unsigned long bdev_start_io_acct(struct block_device *bdev, 963 - unsigned int sectors, enum req_op op, 962 + unsigned long bdev_start_io_acct(struct block_device *bdev, enum req_op op, 964 963 unsigned long start_time) 965 964 { 966 - const int sgrp = op_stat_group(op); 967 - 968 965 part_stat_lock(); 969 966 update_io_ticks(bdev, start_time, false); 970 - part_stat_inc(bdev, ios[sgrp]); 971 - part_stat_add(bdev, sectors[sgrp], sectors); 972 967 part_stat_local_inc(bdev, in_flight[op_is_write(op)]); 973 968 part_stat_unlock(); 974 969 ··· 979 984 */ 980 985 unsigned long bio_start_io_acct(struct bio *bio) 981 986 { 982 - return bdev_start_io_acct(bio->bi_bdev, bio_sectors(bio), 983 - bio_op(bio), jiffies); 987 + return bdev_start_io_acct(bio->bi_bdev, bio_op(bio), jiffies); 984 988 } 985 989 EXPORT_SYMBOL_GPL(bio_start_io_acct); 986 990 987 991 void bdev_end_io_acct(struct block_device *bdev, enum req_op op, 988 - unsigned long start_time) 992 + unsigned int sectors, unsigned long start_time) 989 993 { 990 994 const int sgrp = op_stat_group(op); 991 995 unsigned long now = READ_ONCE(jiffies); ··· 992 998 993 999 part_stat_lock(); 994 1000 update_io_ticks(bdev, now, true); 1001 + part_stat_inc(bdev, ios[sgrp]); 1002 + part_stat_add(bdev, sectors[sgrp], sectors); 995 1003 part_stat_add(bdev, nsecs[sgrp], jiffies_to_nsecs(duration)); 996 1004 part_stat_local_dec(bdev, in_flight[op_is_write(op)]); 997 1005 part_stat_unlock(); ··· 1003 1007 void bio_end_io_acct_remapped(struct bio *bio, unsigned long start_time, 1004 1008 struct block_device *orig_bdev) 1005 1009 { 1006 - bdev_end_io_acct(orig_bdev, bio_op(bio), start_time); 1010 + bdev_end_io_acct(orig_bdev, bio_op(bio), bio_sectors(bio), start_time); 1007 1011 } 1008 1012 EXPORT_SYMBOL_GPL(bio_end_io_acct_remapped); 1009 1013
+3 -2
block/blk-mq.c
··· 2725 2725 struct blk_mq_hw_ctx *this_hctx = NULL; 2726 2726 struct blk_mq_ctx *this_ctx = NULL; 2727 2727 struct request *requeue_list = NULL; 2728 + struct request **requeue_lastp = &requeue_list; 2728 2729 unsigned int depth = 0; 2729 2730 LIST_HEAD(list); 2730 2731 ··· 2736 2735 this_hctx = rq->mq_hctx; 2737 2736 this_ctx = rq->mq_ctx; 2738 2737 } else if (this_hctx != rq->mq_hctx || this_ctx != rq->mq_ctx) { 2739 - rq_list_add(&requeue_list, rq); 2738 + rq_list_add_tail(&requeue_lastp, rq); 2740 2739 continue; 2741 2740 } 2742 - list_add_tail(&rq->queuelist, &list); 2741 + list_add(&rq->queuelist, &list); 2743 2742 depth++; 2744 2743 } while (!rq_list_empty(plug->mq_list)); 2745 2744
+3 -2
block/blk-mq.h
··· 378 378 #define __blk_mq_run_dispatch_ops(q, check_sleep, dispatch_ops) \ 379 379 do { \ 380 380 if ((q)->tag_set->flags & BLK_MQ_F_BLOCKING) { \ 381 + struct blk_mq_tag_set *__tag_set = (q)->tag_set; \ 381 382 int srcu_idx; \ 382 383 \ 383 384 might_sleep_if(check_sleep); \ 384 - srcu_idx = srcu_read_lock((q)->tag_set->srcu); \ 385 + srcu_idx = srcu_read_lock(__tag_set->srcu); \ 385 386 (dispatch_ops); \ 386 - srcu_read_unlock((q)->tag_set->srcu, srcu_idx); \ 387 + srcu_read_unlock(__tag_set->srcu, srcu_idx); \ 387 388 } else { \ 388 389 rcu_read_lock(); \ 389 390 (dispatch_ops); \
+17 -8
drivers/block/loop.c
··· 1859 1859 1860 1860 static void loop_handle_cmd(struct loop_cmd *cmd) 1861 1861 { 1862 + struct cgroup_subsys_state *cmd_blkcg_css = cmd->blkcg_css; 1863 + struct cgroup_subsys_state *cmd_memcg_css = cmd->memcg_css; 1862 1864 struct request *rq = blk_mq_rq_from_pdu(cmd); 1863 1865 const bool write = op_is_write(req_op(rq)); 1864 1866 struct loop_device *lo = rq->q->queuedata; 1865 1867 int ret = 0; 1866 1868 struct mem_cgroup *old_memcg = NULL; 1869 + const bool use_aio = cmd->use_aio; 1867 1870 1868 1871 if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY)) { 1869 1872 ret = -EIO; 1870 1873 goto failed; 1871 1874 } 1872 1875 1873 - if (cmd->blkcg_css) 1874 - kthread_associate_blkcg(cmd->blkcg_css); 1875 - if (cmd->memcg_css) 1876 + if (cmd_blkcg_css) 1877 + kthread_associate_blkcg(cmd_blkcg_css); 1878 + if (cmd_memcg_css) 1876 1879 old_memcg = set_active_memcg( 1877 - mem_cgroup_from_css(cmd->memcg_css)); 1880 + mem_cgroup_from_css(cmd_memcg_css)); 1878 1881 1882 + /* 1883 + * do_req_filebacked() may call blk_mq_complete_request() synchronously 1884 + * or asynchronously if using aio. Hence, do not touch 'cmd' after 1885 + * do_req_filebacked() has returned unless we are sure that 'cmd' has 1886 + * not yet been completed. 1887 + */ 1879 1888 ret = do_req_filebacked(lo, rq); 1880 1889 1881 - if (cmd->blkcg_css) 1890 + if (cmd_blkcg_css) 1882 1891 kthread_associate_blkcg(NULL); 1883 1892 1884 - if (cmd->memcg_css) { 1893 + if (cmd_memcg_css) { 1885 1894 set_active_memcg(old_memcg); 1886 - css_put(cmd->memcg_css); 1895 + css_put(cmd_memcg_css); 1887 1896 } 1888 1897 failed: 1889 1898 /* complete non-aio request */ 1890 - if (!cmd->use_aio || ret) { 1899 + if (!use_aio || ret) { 1891 1900 if (ret == -EOPNOTSUPP) 1892 1901 cmd->ret = ret; 1893 1902 else
+15 -16
drivers/block/null_blk/main.c
··· 1413 1413 case NULL_IRQ_SOFTIRQ: 1414 1414 switch (cmd->nq->dev->queue_mode) { 1415 1415 case NULL_Q_MQ: 1416 - if (likely(!blk_should_fake_timeout(cmd->rq->q))) 1417 - blk_mq_complete_request(cmd->rq); 1416 + blk_mq_complete_request(cmd->rq); 1418 1417 break; 1419 1418 case NULL_Q_BIO: 1420 1419 /* ··· 1657 1658 } 1658 1659 1659 1660 static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, 1660 - const struct blk_mq_queue_data *bd) 1661 + const struct blk_mq_queue_data *bd) 1661 1662 { 1662 - struct nullb_cmd *cmd = blk_mq_rq_to_pdu(bd->rq); 1663 + struct request *rq = bd->rq; 1664 + struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq); 1663 1665 struct nullb_queue *nq = hctx->driver_data; 1664 - sector_t nr_sectors = blk_rq_sectors(bd->rq); 1665 - sector_t sector = blk_rq_pos(bd->rq); 1666 + sector_t nr_sectors = blk_rq_sectors(rq); 1667 + sector_t sector = blk_rq_pos(rq); 1666 1668 const bool is_poll = hctx->type == HCTX_TYPE_POLL; 1667 1669 1668 1670 might_sleep_if(hctx->flags & BLK_MQ_F_BLOCKING); ··· 1672 1672 hrtimer_init(&cmd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1673 1673 cmd->timer.function = null_cmd_timer_expired; 1674 1674 } 1675 - cmd->rq = bd->rq; 1675 + cmd->rq = rq; 1676 1676 cmd->error = BLK_STS_OK; 1677 1677 cmd->nq = nq; 1678 - cmd->fake_timeout = should_timeout_request(bd->rq); 1678 + cmd->fake_timeout = should_timeout_request(rq) || 1679 + blk_should_fake_timeout(rq->q); 1679 1680 1680 - blk_mq_start_request(bd->rq); 1681 + blk_mq_start_request(rq); 1681 1682 1682 - if (should_requeue_request(bd->rq)) { 1683 + if (should_requeue_request(rq)) { 1683 1684 /* 1684 1685 * Alternate between hitting the core BUSY path, and the 1685 1686 * driver driven requeue path ··· 1688 1687 nq->requeue_selection++; 1689 1688 if (nq->requeue_selection & 1) 1690 1689 return BLK_STS_RESOURCE; 1691 - else { 1692 - blk_mq_requeue_request(bd->rq, true); 1693 - return BLK_STS_OK; 1694 - } 1690 + blk_mq_requeue_request(rq, true); 1691 + return BLK_STS_OK; 1695 1692 } 1696 1693 1697 1694 if (is_poll) { 1698 1695 spin_lock(&nq->poll_lock); 1699 - list_add_tail(&bd->rq->queuelist, &nq->poll_list); 1696 + list_add_tail(&rq->queuelist, &nq->poll_list); 1700 1697 spin_unlock(&nq->poll_lock); 1701 1698 return BLK_STS_OK; 1702 1699 } 1703 1700 if (cmd->fake_timeout) 1704 1701 return BLK_STS_OK; 1705 1702 1706 - return null_handle_cmd(cmd, sector, nr_sectors, req_op(bd->rq)); 1703 + return null_handle_cmd(cmd, sector, nr_sectors, req_op(rq)); 1707 1704 } 1708 1705 1709 1706 static void cleanup_queue(struct nullb_queue *nq)
+2
drivers/block/sunvdc.c
··· 972 972 print_version(); 973 973 974 974 hp = mdesc_grab(); 975 + if (!hp) 976 + return -ENODEV; 975 977 976 978 err = -ENODEV; 977 979 if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
+4
drivers/md/Kconfig
··· 15 15 config BLK_DEV_MD 16 16 tristate "RAID support" 17 17 select BLOCK_HOLDER_DEPRECATED if SYSFS 18 + # BLOCK_LEGACY_AUTOLOAD requirement should be removed 19 + # after relevant mdadm enhancements - to make "names=yes" 20 + # the default - are widely available. 21 + select BLOCK_LEGACY_AUTOLOAD 18 22 help 19 23 This driver lets you combine several hard disk partitions into one 20 24 logical block device. This can be used to simply append one
+3 -3
drivers/md/dm.c
··· 512 512 sectors = io->sectors; 513 513 514 514 if (!end) 515 - bdev_start_io_acct(bio->bi_bdev, sectors, bio_op(bio), 516 - start_time); 515 + bdev_start_io_acct(bio->bi_bdev, bio_op(bio), start_time); 517 516 else 518 - bdev_end_io_acct(bio->bi_bdev, bio_op(bio), start_time); 517 + bdev_end_io_acct(bio->bi_bdev, bio_op(bio), sectors, 518 + start_time); 519 519 520 520 if (static_branch_unlikely(&stats_enabled) && 521 521 unlikely(dm_stats_used(&md->stats))) {
+8 -9
drivers/md/md.c
··· 3128 3128 err = kstrtouint(buf, 10, (unsigned int *)&slot); 3129 3129 if (err < 0) 3130 3130 return err; 3131 + if (slot < 0) 3132 + /* overflow */ 3133 + return -ENOSPC; 3131 3134 } 3132 3135 if (rdev->mddev->pers && slot == -1) { 3133 3136 /* Setting 'slot' on an active array requires also ··· 6259 6256 mddev->to_remove = &md_redundancy_group; 6260 6257 module_put(pers->owner); 6261 6258 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); 6259 + 6260 + percpu_ref_exit(&mddev->writes_pending); 6261 + percpu_ref_exit(&mddev->active_io); 6262 + bioset_exit(&mddev->bio_set); 6263 + bioset_exit(&mddev->sync_set); 6262 6264 } 6263 6265 6264 6266 void md_stop(struct mddev *mddev) ··· 6273 6265 */ 6274 6266 __md_stop_writes(mddev); 6275 6267 __md_stop(mddev); 6276 - percpu_ref_exit(&mddev->writes_pending); 6277 - percpu_ref_exit(&mddev->active_io); 6278 - bioset_exit(&mddev->bio_set); 6279 - bioset_exit(&mddev->sync_set); 6280 6268 } 6281 6269 6282 6270 EXPORT_SYMBOL_GPL(md_stop); ··· 7842 7838 static void md_free_disk(struct gendisk *disk) 7843 7839 { 7844 7840 struct mddev *mddev = disk->private_data; 7845 - 7846 - percpu_ref_exit(&mddev->writes_pending); 7847 - percpu_ref_exit(&mddev->active_io); 7848 - bioset_exit(&mddev->bio_set); 7849 - bioset_exit(&mddev->sync_set); 7850 7841 7851 7842 mddev_free(mddev); 7852 7843 }
+18 -8
drivers/nvme/host/core.c
··· 781 781 range = page_address(ns->ctrl->discard_page); 782 782 } 783 783 784 - __rq_for_each_bio(bio, req) { 785 - u64 slba = nvme_sect_to_lba(ns, bio->bi_iter.bi_sector); 786 - u32 nlb = bio->bi_iter.bi_size >> ns->lba_shift; 784 + if (queue_max_discard_segments(req->q) == 1) { 785 + u64 slba = nvme_sect_to_lba(ns, blk_rq_pos(req)); 786 + u32 nlb = blk_rq_sectors(req) >> (ns->lba_shift - 9); 787 787 788 - if (n < segments) { 789 - range[n].cattr = cpu_to_le32(0); 790 - range[n].nlb = cpu_to_le32(nlb); 791 - range[n].slba = cpu_to_le64(slba); 788 + range[0].cattr = cpu_to_le32(0); 789 + range[0].nlb = cpu_to_le32(nlb); 790 + range[0].slba = cpu_to_le64(slba); 791 + n = 1; 792 + } else { 793 + __rq_for_each_bio(bio, req) { 794 + u64 slba = nvme_sect_to_lba(ns, bio->bi_iter.bi_sector); 795 + u32 nlb = bio->bi_iter.bi_size >> ns->lba_shift; 796 + 797 + if (n < segments) { 798 + range[n].cattr = cpu_to_le32(0); 799 + range[n].nlb = cpu_to_le32(nlb); 800 + range[n].slba = cpu_to_le64(slba); 801 + } 802 + n++; 792 803 } 793 - n++; 794 804 } 795 805 796 806 if (WARN_ON_ONCE(n != segments)) {
+4 -4
drivers/nvme/host/multipath.c
··· 123 123 return; 124 124 125 125 nvme_req(rq)->flags |= NVME_MPATH_IO_STATS; 126 - nvme_req(rq)->start_time = bdev_start_io_acct(disk->part0, 127 - blk_rq_bytes(rq) >> SECTOR_SHIFT, 128 - req_op(rq), jiffies); 126 + nvme_req(rq)->start_time = bdev_start_io_acct(disk->part0, req_op(rq), 127 + jiffies); 129 128 } 130 129 EXPORT_SYMBOL_GPL(nvme_mpath_start_request); 131 130 ··· 135 136 if (!(nvme_req(rq)->flags & NVME_MPATH_IO_STATS)) 136 137 return; 137 138 bdev_end_io_acct(ns->head->disk->part0, req_op(rq), 138 - nvme_req(rq)->start_time); 139 + blk_rq_bytes(rq) >> SECTOR_SHIFT, 140 + nvme_req(rq)->start_time); 139 141 } 140 142 141 143 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)
+5
drivers/nvme/host/pci.c
··· 3073 3073 nvme_dev_unmap(dev); 3074 3074 out_uninit_ctrl: 3075 3075 nvme_uninit_ctrl(&dev->ctrl); 3076 + nvme_put_ctrl(&dev->ctrl); 3076 3077 return result; 3077 3078 } 3078 3079 ··· 3416 3415 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3417 3416 { PCI_DEVICE(0x2646, 0x501E), /* KINGSTON OM3PGP4xxxxQ OS21011 NVMe SSD */ 3418 3417 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3418 + { PCI_DEVICE(0x1f40, 0x1202), /* Netac Technologies Co. NV3000 NVMe SSD */ 3419 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3419 3420 { PCI_DEVICE(0x1f40, 0x5236), /* Netac Technologies Co. NV7000 NVMe SSD */ 3420 3421 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3421 3422 { PCI_DEVICE(0x1e4B, 0x1001), /* MAXIO MAP1001 */ ··· 3437 3434 { PCI_DEVICE(0xc0a9, 0x540a), /* Crucial P2 */ 3438 3435 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3439 3436 { PCI_DEVICE(0x1d97, 0x2263), /* Lexar NM610 */ 3437 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3438 + { PCI_DEVICE(0x1d97, 0x1d97), /* Lexar NM620 */ 3440 3439 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3441 3440 { PCI_DEVICE(0x1d97, 0x2269), /* Lexar NM760 */ 3442 3441 .driver_data = NVME_QUIRK_BOGUS_NID, },
+27 -6
drivers/nvme/host/tcp.c
··· 208 208 return queue->data_digest ? NVME_TCP_DIGEST_LENGTH : 0; 209 209 } 210 210 211 + static inline void *nvme_tcp_req_cmd_pdu(struct nvme_tcp_request *req) 212 + { 213 + return req->pdu; 214 + } 215 + 216 + static inline void *nvme_tcp_req_data_pdu(struct nvme_tcp_request *req) 217 + { 218 + /* use the pdu space in the back for the data pdu */ 219 + return req->pdu + sizeof(struct nvme_tcp_cmd_pdu) - 220 + sizeof(struct nvme_tcp_data_pdu); 221 + } 222 + 211 223 static inline size_t nvme_tcp_inline_data_size(struct nvme_tcp_request *req) 212 224 { 213 225 if (nvme_is_fabrics(req->req.cmd)) ··· 626 614 627 615 static void nvme_tcp_setup_h2c_data_pdu(struct nvme_tcp_request *req) 628 616 { 629 - struct nvme_tcp_data_pdu *data = req->pdu; 617 + struct nvme_tcp_data_pdu *data = nvme_tcp_req_data_pdu(req); 630 618 struct nvme_tcp_queue *queue = req->queue; 631 619 struct request *rq = blk_mq_rq_from_pdu(req); 632 620 u32 h2cdata_sent = req->pdu_len; ··· 1050 1038 static int nvme_tcp_try_send_cmd_pdu(struct nvme_tcp_request *req) 1051 1039 { 1052 1040 struct nvme_tcp_queue *queue = req->queue; 1053 - struct nvme_tcp_cmd_pdu *pdu = req->pdu; 1041 + struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); 1054 1042 bool inline_data = nvme_tcp_has_inline_data(req); 1055 1043 u8 hdgst = nvme_tcp_hdgst_len(queue); 1056 1044 int len = sizeof(*pdu) + hdgst - req->offset; ··· 1089 1077 static int nvme_tcp_try_send_data_pdu(struct nvme_tcp_request *req) 1090 1078 { 1091 1079 struct nvme_tcp_queue *queue = req->queue; 1092 - struct nvme_tcp_data_pdu *pdu = req->pdu; 1080 + struct nvme_tcp_data_pdu *pdu = nvme_tcp_req_data_pdu(req); 1093 1081 u8 hdgst = nvme_tcp_hdgst_len(queue); 1094 1082 int len = sizeof(*pdu) - req->offset + hdgst; 1095 1083 int ret; ··· 2296 2284 { 2297 2285 struct nvme_tcp_request *req = blk_mq_rq_to_pdu(rq); 2298 2286 struct nvme_ctrl *ctrl = &req->queue->ctrl->ctrl; 2299 - struct nvme_tcp_cmd_pdu *pdu = req->pdu; 2287 + struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); 2300 2288 u8 opc = pdu->cmd.common.opcode, fctype = pdu->cmd.fabrics.fctype; 2301 2289 int qid = nvme_tcp_queue_id(req->queue); 2302 2290 ··· 2335 2323 struct request *rq) 2336 2324 { 2337 2325 struct nvme_tcp_request *req = blk_mq_rq_to_pdu(rq); 2338 - struct nvme_tcp_cmd_pdu *pdu = req->pdu; 2326 + struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); 2339 2327 struct nvme_command *c = &pdu->cmd; 2340 2328 2341 2329 c->common.flags |= NVME_CMD_SGL_METABUF; ··· 2355 2343 struct request *rq) 2356 2344 { 2357 2345 struct nvme_tcp_request *req = blk_mq_rq_to_pdu(rq); 2358 - struct nvme_tcp_cmd_pdu *pdu = req->pdu; 2346 + struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); 2359 2347 struct nvme_tcp_queue *queue = req->queue; 2360 2348 u8 hdgst = nvme_tcp_hdgst_len(queue), ddgst = 0; 2361 2349 blk_status_t ret; ··· 2694 2682 2695 2683 static int __init nvme_tcp_init_module(void) 2696 2684 { 2685 + BUILD_BUG_ON(sizeof(struct nvme_tcp_hdr) != 8); 2686 + BUILD_BUG_ON(sizeof(struct nvme_tcp_cmd_pdu) != 72); 2687 + BUILD_BUG_ON(sizeof(struct nvme_tcp_data_pdu) != 24); 2688 + BUILD_BUG_ON(sizeof(struct nvme_tcp_rsp_pdu) != 24); 2689 + BUILD_BUG_ON(sizeof(struct nvme_tcp_r2t_pdu) != 24); 2690 + BUILD_BUG_ON(sizeof(struct nvme_tcp_icreq_pdu) != 128); 2691 + BUILD_BUG_ON(sizeof(struct nvme_tcp_icresp_pdu) != 128); 2692 + BUILD_BUG_ON(sizeof(struct nvme_tcp_term_pdu) != 24); 2693 + 2697 2694 nvme_tcp_wq = alloc_workqueue("nvme_tcp_wq", 2698 2695 WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); 2699 2696 if (!nvme_tcp_wq)
+3 -1
drivers/nvme/target/core.c
··· 756 756 757 757 void nvmet_req_complete(struct nvmet_req *req, u16 status) 758 758 { 759 + struct nvmet_sq *sq = req->sq; 760 + 759 761 __nvmet_req_complete(req, status); 760 - percpu_ref_put(&req->sq->ref); 762 + percpu_ref_put(&sq->ref); 761 763 } 762 764 EXPORT_SYMBOL_GPL(nvmet_req_complete); 763 765
+6
include/linux/blk-mq.h
··· 228 228 *(listptr) = rq; \ 229 229 } while (0) 230 230 231 + #define rq_list_add_tail(lastpptr, rq) do { \ 232 + (rq)->rq_next = NULL; \ 233 + **(lastpptr) = rq; \ 234 + *(lastpptr) = &rq->rq_next; \ 235 + } while (0) 236 + 231 237 #define rq_list_pop(listptr) \ 232 238 ({ \ 233 239 struct request *__req = NULL; \
+2 -3
include/linux/blkdev.h
··· 1446 1446 wake_up_process(waiter); 1447 1447 } 1448 1448 1449 - unsigned long bdev_start_io_acct(struct block_device *bdev, 1450 - unsigned int sectors, enum req_op op, 1449 + unsigned long bdev_start_io_acct(struct block_device *bdev, enum req_op op, 1451 1450 unsigned long start_time); 1452 1451 void bdev_end_io_acct(struct block_device *bdev, enum req_op op, 1453 - unsigned long start_time); 1452 + unsigned int sectors, unsigned long start_time); 1454 1453 1455 1454 unsigned long bio_start_io_acct(struct bio *bio); 1456 1455 void bio_end_io_acct_remapped(struct bio *bio, unsigned long start_time,
+5
include/linux/nvme.h
··· 812 812 nvme_opcode_name(nvme_cmd_compare), \ 813 813 nvme_opcode_name(nvme_cmd_write_zeroes), \ 814 814 nvme_opcode_name(nvme_cmd_dsm), \ 815 + nvme_opcode_name(nvme_cmd_verify), \ 815 816 nvme_opcode_name(nvme_cmd_resv_register), \ 816 817 nvme_opcode_name(nvme_cmd_resv_report), \ 817 818 nvme_opcode_name(nvme_cmd_resv_acquire), \ ··· 1145 1144 nvme_admin_opcode_name(nvme_admin_ns_mgmt), \ 1146 1145 nvme_admin_opcode_name(nvme_admin_activate_fw), \ 1147 1146 nvme_admin_opcode_name(nvme_admin_download_fw), \ 1147 + nvme_admin_opcode_name(nvme_admin_dev_self_test), \ 1148 1148 nvme_admin_opcode_name(nvme_admin_ns_attach), \ 1149 1149 nvme_admin_opcode_name(nvme_admin_keep_alive), \ 1150 1150 nvme_admin_opcode_name(nvme_admin_directive_send), \ 1151 1151 nvme_admin_opcode_name(nvme_admin_directive_recv), \ 1152 + nvme_admin_opcode_name(nvme_admin_virtual_mgmt), \ 1153 + nvme_admin_opcode_name(nvme_admin_nvme_mi_send), \ 1154 + nvme_admin_opcode_name(nvme_admin_nvme_mi_recv), \ 1152 1155 nvme_admin_opcode_name(nvme_admin_dbbuf), \ 1153 1156 nvme_admin_opcode_name(nvme_admin_format_nvm), \ 1154 1157 nvme_admin_opcode_name(nvme_admin_security_send), \