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

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

Pull block layer fixes from Jens Axboe:
"Sending this off now, as I'm not aware of other current bugs, nor do I
expect further fixes before 4.1 final. This contains two fixes:

- a fix for a bdi unregister warning that gets spewed on md, due to a
regression introduced earlier in this cycle. From Neil Brown.

- a fix for a compile warning for NVMe on 32-bit platforms, also a
regression introduced in this cycle. From Arnd Bergmann"

* 'for-linus' of git://git.kernel.dk/linux-block:
NVMe: fix type warning on 32-bit
block: discard bdi_unregister() in favour of bdi_destroy()

+7 -24
-1
block/genhd.c
··· 653 653 disk->flags &= ~GENHD_FL_UP; 654 654 655 655 sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi"); 656 - bdi_unregister(&disk->queue->backing_dev_info); 657 656 blk_unregister_queue(disk); 658 657 blk_unregister_region(disk_devt(disk), disk->minors); 659 658
+6 -4
drivers/block/nvme-core.c
··· 1750 1750 struct nvme_iod *iod; 1751 1751 dma_addr_t meta_dma = 0; 1752 1752 void *meta = NULL; 1753 + void __user *metadata; 1753 1754 1754 1755 if (copy_from_user(&io, uio, sizeof(io))) 1755 1756 return -EFAULT; ··· 1763 1762 length += meta_len; 1764 1763 meta_len = 0; 1765 1764 } 1765 + 1766 + metadata = (void __user *)(unsigned long)io.metadata; 1766 1767 1767 1768 write = io.opcode & 1; 1768 1769 ··· 1789 1786 if (meta_len) { 1790 1787 meta = dma_alloc_coherent(&dev->pci_dev->dev, meta_len, 1791 1788 &meta_dma, GFP_KERNEL); 1789 + 1792 1790 if (!meta) { 1793 1791 status = -ENOMEM; 1794 1792 goto unmap; 1795 1793 } 1796 1794 if (write) { 1797 - if (copy_from_user(meta, (void __user *)io.metadata, 1798 - meta_len)) { 1795 + if (copy_from_user(meta, metadata, meta_len)) { 1799 1796 status = -EFAULT; 1800 1797 goto unmap; 1801 1798 } ··· 1822 1819 nvme_free_iod(dev, iod); 1823 1820 if (meta) { 1824 1821 if (status == NVME_SC_SUCCESS && !write) { 1825 - if (copy_to_user((void __user *)io.metadata, meta, 1826 - meta_len)) 1822 + if (copy_to_user(metadata, meta, meta_len)) 1827 1823 status = -EFAULT; 1828 1824 } 1829 1825 dma_free_coherent(&dev->pci_dev->dev, meta_len, meta, meta_dma);
-1
include/linux/backing-dev.h
··· 116 116 int bdi_register(struct backing_dev_info *bdi, struct device *parent, 117 117 const char *fmt, ...); 118 118 int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 119 - void bdi_unregister(struct backing_dev_info *bdi); 120 119 int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); 121 120 void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, 122 121 enum wb_reason reason);
-1
include/trace/events/writeback.h
··· 250 250 DEFINE_WRITEBACK_EVENT(writeback_nowork); 251 251 DEFINE_WRITEBACK_EVENT(writeback_wake_background); 252 252 DEFINE_WRITEBACK_EVENT(writeback_bdi_register); 253 - DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); 254 253 255 254 DECLARE_EVENT_CLASS(wbc_class, 256 255 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
+1 -17
mm/backing-dev.c
··· 359 359 flush_delayed_work(&bdi->wb.dwork); 360 360 } 361 361 362 - /* 363 - * Called when the device behind @bdi has been removed or ejected. 364 - * 365 - * We can't really do much here except for reducing the dirty ratio at 366 - * the moment. In the future we should be able to set a flag so that 367 - * the filesystem can handle errors at mark_inode_dirty time instead 368 - * of only at writeback time. 369 - */ 370 - void bdi_unregister(struct backing_dev_info *bdi) 371 - { 372 - if (WARN_ON_ONCE(!bdi->dev)) 373 - return; 374 - 375 - bdi_set_min_ratio(bdi, 0); 376 - } 377 - EXPORT_SYMBOL(bdi_unregister); 378 - 379 362 static void bdi_wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi) 380 363 { 381 364 memset(wb, 0, sizeof(*wb)); ··· 426 443 int i; 427 444 428 445 bdi_wb_shutdown(bdi); 446 + bdi_set_min_ratio(bdi, 0); 429 447 430 448 WARN_ON(!list_empty(&bdi->work_list)); 431 449 WARN_ON(delayed_work_pending(&bdi->wb.dwork));