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

Pull block fixes from Jens Axboe:
"A few fixes for the current series. This contains:

- Two fixes for NVMe:

One fixes a reset race that can be triggered by repeated
insert/removal of the module.

The other fixes an issue on some platforms, where we get probe
timeouts since legacy interrupts isn't working. This used not to
be a problem since we had the worker thread poll for completions,
but since that was killed off, it means those poor souls can't
successfully probe their NVMe device. Use a proper IRQ check and
probe (msi-x -> msi ->legacy), like most other drivers to work
around this. Both from Keith.

- A loop corruption issue with offset in iters, from Ming Lei.

- A fix for not having the partition stat per cpu ref count
initialized before sending out the KOBJ_ADD, which could cause user
space to access the counter prior to initialization. Also from
Ming Lei.

- A fix for using the wrong congestion state, from Kaixu Xia"

* 'for-linus' of git://git.kernel.dk/linux-block:
block: loop: fix filesystem corruption in case of aio/dio
NVMe: Always use MSI/MSI-x interrupts
NVMe: Fix reset/remove race
writeback: fix the wrong congested state variable definition
block: partition: initialize percpuref before sending out KOBJ_ADD

+37 -17
+10 -3
block/partition-generic.c
··· 361 361 goto out_del; 362 362 } 363 363 364 + err = hd_ref_init(p); 365 + if (err) { 366 + if (flags & ADDPART_FLAG_WHOLEDISK) 367 + goto out_remove_file; 368 + goto out_del; 369 + } 370 + 364 371 /* everything is up and running, commence */ 365 372 rcu_assign_pointer(ptbl->part[partno], p); 366 373 367 374 /* suppress uevent if the disk suppresses it */ 368 375 if (!dev_get_uevent_suppress(ddev)) 369 376 kobject_uevent(&pdev->kobj, KOBJ_ADD); 370 - 371 - if (!hd_ref_init(p)) 372 - return p; 377 + return p; 373 378 374 379 out_free_info: 375 380 free_part_info(p); ··· 383 378 out_free: 384 379 kfree(p); 385 380 return ERR_PTR(err); 381 + out_remove_file: 382 + device_remove_file(pdev, &dev_attr_whole_disk); 386 383 out_del: 387 384 kobject_put(p->holder_dir); 388 385 device_del(pdev);
+6
drivers/block/loop.c
··· 488 488 bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); 489 489 iov_iter_bvec(&iter, ITER_BVEC | rw, bvec, 490 490 bio_segments(bio), blk_rq_bytes(cmd->rq)); 491 + /* 492 + * This bio may be started from the middle of the 'bvec' 493 + * because of bio splitting, so offset from the bvec must 494 + * be passed to iov iterator 495 + */ 496 + iter.iov_offset = bio->bi_iter.bi_bvec_done; 491 497 492 498 cmd->iocb.ki_pos = pos; 493 499 cmd->iocb.ki_filp = file;
+19 -12
drivers/nvme/host/pci.c
··· 1478 1478 if (result > 0) { 1479 1479 dev_err(dev->ctrl.device, 1480 1480 "Could not set queue count (%d)\n", result); 1481 - nr_io_queues = 0; 1482 - result = 0; 1481 + return 0; 1483 1482 } 1484 1483 1485 1484 if (dev->cmb && NVME_CMB_SQS(dev->cmbsz)) { ··· 1512 1513 * If we enable msix early due to not intx, disable it again before 1513 1514 * setting up the full range we need. 1514 1515 */ 1515 - if (!pdev->irq) 1516 + if (pdev->msi_enabled) 1517 + pci_disable_msi(pdev); 1518 + else if (pdev->msix_enabled) 1516 1519 pci_disable_msix(pdev); 1517 1520 1518 1521 for (i = 0; i < nr_io_queues; i++) ··· 1697 1696 if (pci_enable_device_mem(pdev)) 1698 1697 return result; 1699 1698 1700 - dev->entry[0].vector = pdev->irq; 1701 1699 pci_set_master(pdev); 1702 1700 1703 1701 if (dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64)) && ··· 1709 1709 } 1710 1710 1711 1711 /* 1712 - * Some devices don't advertse INTx interrupts, pre-enable a single 1713 - * MSIX vec for setup. We'll adjust this later. 1712 + * Some devices and/or platforms don't advertise or work with INTx 1713 + * interrupts. Pre-enable a single MSIX or MSI vec for setup. We'll 1714 + * adjust this later. 1714 1715 */ 1715 - if (!pdev->irq) { 1716 - result = pci_enable_msix(pdev, dev->entry, 1); 1717 - if (result < 0) 1718 - goto disable; 1716 + if (pci_enable_msix(pdev, dev->entry, 1)) { 1717 + pci_enable_msi(pdev); 1718 + dev->entry[0].vector = pdev->irq; 1719 + } 1720 + 1721 + if (!dev->entry[0].vector) { 1722 + result = -ENODEV; 1723 + goto disable; 1719 1724 } 1720 1725 1721 1726 cap = lo_hi_readq(dev->bar + NVME_REG_CAP); ··· 1863 1858 */ 1864 1859 if (dev->ctrl.ctrl_config & NVME_CC_ENABLE) 1865 1860 nvme_dev_disable(dev, false); 1861 + 1862 + if (test_bit(NVME_CTRL_REMOVING, &dev->flags)) 1863 + goto out; 1866 1864 1867 1865 set_bit(NVME_CTRL_RESETTING, &dev->flags); 1868 1866 ··· 2086 2078 { 2087 2079 struct nvme_dev *dev = pci_get_drvdata(pdev); 2088 2080 2089 - del_timer_sync(&dev->watchdog_timer); 2090 - 2091 2081 set_bit(NVME_CTRL_REMOVING, &dev->flags); 2092 2082 pci_set_drvdata(pdev, NULL); 2093 2083 flush_work(&dev->async_work); 2084 + flush_work(&dev->reset_work); 2094 2085 flush_work(&dev->scan_work); 2095 2086 nvme_remove_namespaces(&dev->ctrl); 2096 2087 nvme_uninit_ctrl(&dev->ctrl);
+2 -2
mm/backing-dev.c
··· 898 898 void clear_wb_congested(struct bdi_writeback_congested *congested, int sync) 899 899 { 900 900 wait_queue_head_t *wqh = &congestion_wqh[sync]; 901 - enum wb_state bit; 901 + enum wb_congested_state bit; 902 902 903 903 bit = sync ? WB_sync_congested : WB_async_congested; 904 904 if (test_and_clear_bit(bit, &congested->state)) ··· 911 911 912 912 void set_wb_congested(struct bdi_writeback_congested *congested, int sync) 913 913 { 914 - enum wb_state bit; 914 + enum wb_congested_state bit; 915 915 916 916 bit = sync ? WB_sync_congested : WB_async_congested; 917 917 if (!test_and_set_bit(bit, &congested->state))