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-20190118' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- block size setting fixes for loop/nbd (Jan Kara)

- md bio_alloc_mddev() cleanup (Marcos)

- Ensure we don't lose the REQ_INTEGRITY flag (Ming)

- Two NVMe fixes by way of Christoph:
- Fix NVMe IRQ calculation (Ming)
- Uninitialized variable in nvmet-tcp (Sagi)

- BFQ comment fix (Paolo)

- License cleanup for recently added blk-mq-debugfs-zoned (Thomas)

* tag 'for-linus-20190118' of git://git.kernel.dk/linux-block:
block: Cleanup license notice
nvme-pci: fix nvme_setup_irqs()
nvmet-tcp: fix uninitialized variable access
block: don't lose track of REQ_INTEGRITY flag
blockdev: Fix livelocks on loop device
nbd: Use set_blocksize() to set device blocksize
md: Make bio_alloc_mddev use bio_alloc_bioset
block, bfq: fix comments on __bfq_deactivate_entity

+43 -36
+5 -6
block/bfq-wf2q.c
··· 1154 1154 } 1155 1155 1156 1156 /** 1157 - * __bfq_deactivate_entity - deactivate an entity from its service tree. 1158 - * @entity: the entity to deactivate. 1157 + * __bfq_deactivate_entity - update sched_data and service trees for 1158 + * entity, so as to represent entity as inactive 1159 + * @entity: the entity being deactivated. 1159 1160 * @ins_into_idle_tree: if false, the entity will not be put into the 1160 1161 * idle tree. 1161 1162 * 1162 - * Deactivates an entity, independently of its previous state. Must 1163 - * be invoked only if entity is on a service tree. Extracts the entity 1164 - * from that tree, and if necessary and allowed, puts it into the idle 1165 - * tree. 1163 + * If necessary and allowed, puts entity into the idle tree. NOTE: 1164 + * entity may be on no tree if in service. 1166 1165 */ 1167 1166 bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree) 1168 1167 {
-2
block/blk-mq-debugfs-zoned.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 3 * Copyright (C) 2017 Western Digital Corporation or its affiliates. 4 - * 5 - * This file is released under the GPL. 6 4 */ 7 5 8 6 #include <linux/blkdev.h>
+2 -1
block/blk-mq.c
··· 1906 1906 { 1907 1907 const int is_sync = op_is_sync(bio->bi_opf); 1908 1908 const int is_flush_fua = op_is_flush(bio->bi_opf); 1909 - struct blk_mq_alloc_data data = { .flags = 0, .cmd_flags = bio->bi_opf }; 1909 + struct blk_mq_alloc_data data = { .flags = 0}; 1910 1910 struct request *rq; 1911 1911 struct blk_plug *plug; 1912 1912 struct request *same_queue_rq = NULL; ··· 1928 1928 1929 1929 rq_qos_throttle(q, bio); 1930 1930 1931 + data.cmd_flags = bio->bi_opf; 1931 1932 rq = blk_mq_get_request(q, bio, &data); 1932 1933 if (unlikely(!rq)) { 1933 1934 rq_qos_cleanup(q, bio);
+3 -2
drivers/block/nbd.c
··· 288 288 blk_queue_physical_block_size(nbd->disk->queue, config->blksize); 289 289 set_capacity(nbd->disk, config->bytesize >> 9); 290 290 if (bdev) { 291 - if (bdev->bd_disk) 291 + if (bdev->bd_disk) { 292 292 bd_set_size(bdev, config->bytesize); 293 - else 293 + set_blocksize(bdev, config->blksize); 294 + } else 294 295 bdev->bd_invalidated = 1; 295 296 bdput(bdev); 296 297 }
+1 -6
drivers/md/md.c
··· 207 207 struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, 208 208 struct mddev *mddev) 209 209 { 210 - struct bio *b; 211 - 212 210 if (!mddev || !bioset_initialized(&mddev->bio_set)) 213 211 return bio_alloc(gfp_mask, nr_iovecs); 214 212 215 - b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); 216 - if (!b) 217 - return NULL; 218 - return b; 213 + return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); 219 214 } 220 215 EXPORT_SYMBOL_GPL(bio_alloc_mddev); 221 216
+13 -8
drivers/nvme/host/pci.c
··· 2041 2041 return ret; 2042 2042 } 2043 2043 2044 + /* irq_queues covers admin queue */ 2044 2045 static void nvme_calc_io_queues(struct nvme_dev *dev, unsigned int irq_queues) 2045 2046 { 2046 2047 unsigned int this_w_queues = write_queues; 2047 2048 2049 + WARN_ON(!irq_queues); 2050 + 2048 2051 /* 2049 - * Setup read/write queue split 2052 + * Setup read/write queue split, assign admin queue one independent 2053 + * irq vector if irq_queues is > 1. 2050 2054 */ 2051 - if (irq_queues == 1) { 2055 + if (irq_queues <= 2) { 2052 2056 dev->io_queues[HCTX_TYPE_DEFAULT] = 1; 2053 2057 dev->io_queues[HCTX_TYPE_READ] = 0; 2054 2058 return; ··· 2060 2056 2061 2057 /* 2062 2058 * If 'write_queues' is set, ensure it leaves room for at least 2063 - * one read queue 2059 + * one read queue and one admin queue 2064 2060 */ 2065 2061 if (this_w_queues >= irq_queues) 2066 - this_w_queues = irq_queues - 1; 2062 + this_w_queues = irq_queues - 2; 2067 2063 2068 2064 /* 2069 2065 * If 'write_queues' is set to zero, reads and writes will share 2070 2066 * a queue set. 2071 2067 */ 2072 2068 if (!this_w_queues) { 2073 - dev->io_queues[HCTX_TYPE_DEFAULT] = irq_queues; 2069 + dev->io_queues[HCTX_TYPE_DEFAULT] = irq_queues - 1; 2074 2070 dev->io_queues[HCTX_TYPE_READ] = 0; 2075 2071 } else { 2076 2072 dev->io_queues[HCTX_TYPE_DEFAULT] = this_w_queues; 2077 - dev->io_queues[HCTX_TYPE_READ] = irq_queues - this_w_queues; 2073 + dev->io_queues[HCTX_TYPE_READ] = irq_queues - this_w_queues - 1; 2078 2074 } 2079 2075 } 2080 2076 ··· 2099 2095 this_p_queues = nr_io_queues - 1; 2100 2096 irq_queues = 1; 2101 2097 } else { 2102 - irq_queues = nr_io_queues - this_p_queues; 2098 + irq_queues = nr_io_queues - this_p_queues + 1; 2103 2099 } 2104 2100 dev->io_queues[HCTX_TYPE_POLL] = this_p_queues; 2105 2101 ··· 2119 2115 * If we got a failure and we're down to asking for just 2120 2116 * 1 + 1 queues, just ask for a single vector. We'll share 2121 2117 * that between the single IO queue and the admin queue. 2118 + * Otherwise, we assign one independent vector to admin queue. 2122 2119 */ 2123 - if (result >= 0 && irq_queues > 1) 2120 + if (irq_queues > 1) 2124 2121 irq_queues = irq_sets[0] + irq_sets[1] + 1; 2125 2122 2126 2123 result = pci_alloc_irq_vectors_affinity(pdev, irq_queues,
+1 -1
drivers/nvme/target/tcp.c
··· 1089 1089 1090 1090 static int nvmet_tcp_try_recv_one(struct nvmet_tcp_queue *queue) 1091 1091 { 1092 - int result; 1092 + int result = 0; 1093 1093 1094 1094 if (unlikely(queue->rcv_state == NVMET_TCP_RECV_ERR)) 1095 1095 return 0;
+18 -10
fs/block_dev.c
··· 104 104 } 105 105 EXPORT_SYMBOL(invalidate_bdev); 106 106 107 + static void set_init_blocksize(struct block_device *bdev) 108 + { 109 + unsigned bsize = bdev_logical_block_size(bdev); 110 + loff_t size = i_size_read(bdev->bd_inode); 111 + 112 + while (bsize < PAGE_SIZE) { 113 + if (size & bsize) 114 + break; 115 + bsize <<= 1; 116 + } 117 + bdev->bd_block_size = bsize; 118 + bdev->bd_inode->i_blkbits = blksize_bits(bsize); 119 + } 120 + 107 121 int set_blocksize(struct block_device *bdev, int size) 108 122 { 109 123 /* Size must be a power of two, and between 512 and PAGE_SIZE */ ··· 1445 1431 1446 1432 void bd_set_size(struct block_device *bdev, loff_t size) 1447 1433 { 1448 - unsigned bsize = bdev_logical_block_size(bdev); 1449 - 1450 1434 inode_lock(bdev->bd_inode); 1451 1435 i_size_write(bdev->bd_inode, size); 1452 1436 inode_unlock(bdev->bd_inode); 1453 - while (bsize < PAGE_SIZE) { 1454 - if (size & bsize) 1455 - break; 1456 - bsize <<= 1; 1457 - } 1458 - bdev->bd_block_size = bsize; 1459 - bdev->bd_inode->i_blkbits = blksize_bits(bsize); 1460 1437 } 1461 1438 EXPORT_SYMBOL(bd_set_size); 1462 1439 ··· 1524 1519 } 1525 1520 } 1526 1521 1527 - if (!ret) 1522 + if (!ret) { 1528 1523 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); 1524 + set_init_blocksize(bdev); 1525 + } 1529 1526 1530 1527 /* 1531 1528 * If the device is invalidated, rescan partition ··· 1562 1555 goto out_clear; 1563 1556 } 1564 1557 bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9); 1558 + set_init_blocksize(bdev); 1565 1559 } 1566 1560 1567 1561 if (bdev->bd_bdi == &noop_backing_dev_info)