lkml.org 
[lkml]   [2016]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[GIT PULL] libnvdimm-fixes for 4.5-rc2
Date
Hi Linus, please pull from:

  git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes

1/ Fixes to the libnvdimm 'pfn' device that establishes a reserved area
for storing a struct page array.

2/ Fixes for dax operations on a raw block device to prevent pagecache
collisions with dax mappings.

3/ A fix for pfn_t usage in vm_insert_mixed that lead to a null pointer
de-reference.

These have received build success notification from the kbuild robot
across 153 configs and pass the latest ndctl tests.

Note that the below commits are also in -mm, but as Andrew is offline
until tomorrow I thought it best to submit these for 4.5-rc2
consideration.  Please yell if I should just wait next time:
 
65f87ee71852 fs, block: force direct-I/O for dax-enabled block devices
03fc2da63b9a mm: fix pfn_t to page conversion in vm_insert_mixed
76e9f0ee52b0 phys_to_pfn_t: use phys_addr_t


The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:

  Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes

for you to fetch changes up to 76e9f0ee52b0be5761e29847e0ef01f23f24f1df:

  phys_to_pfn_t: use phys_addr_t (2016-01-31 09:10:19 -0800)

----------------------------------------------------------------
Dan Williams (8):
      libnvdimm: fix mode determination for e820 devices
      libnvdimm, pfn: fix restoring memmap location
      devm_memremap_pages: fix vmem_altmap lifetime + alignment handling
      fs, block: force direct-I/O for dax-enabled block devices
      block: revert runtime dax control of the raw block device
      block: use DAX for partition table reads
      mm: fix pfn_t to page conversion in vm_insert_mixed
      phys_to_pfn_t: use phys_addr_t

 block/ioctl.c                     | 38 --------------------------------------
 block/partition-generic.c         | 18 +++++++++++++++---
 drivers/nvdimm/namespace_devs.c   |  8 +++++---
 drivers/nvdimm/pfn_devs.c         |  4 +---
 fs/block_dev.c                    | 28 ----------------------------
 fs/dax.c                          | 20 ++++++++++++++++++++
 include/linux/dax.h               | 11 +++++++++++
 include/linux/fs.h                |  5 +----
 include/linux/pfn_t.h             |  4 ++--
 include/uapi/linux/fs.h           |  1 -
 kernel/memremap.c                 | 20 ++++++++++++--------
 mm/memory.c                       |  9 +++++++--
 tools/testing/nvdimm/test/iomap.c |  2 +-
 13 files changed, 75 insertions(+), 93 deletions(-)

commit 9c41242817f4b6d908886c0fdb036d9246c50630
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Jan 23 15:34:10 2016 -0800

    libnvdimm: fix mode determination for e820 devices
    
    Correctly display "safe" mode when a btt is established on a e820/memmap
    defined pmem namespace.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 45eb570a0db3391c88cba04510a20fe7e4125497
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Jan 29 17:42:51 2016 -0800

    libnvdimm, pfn: fix restoring memmap location
    
    This path was missed when turning on the memmap in pmem support.  Permit
    'pmem' as a valid location for the map.
    
    Reported-by: Jeff Moyer <jmoyer@redhat.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit eb7d78c9e7f6418932bd5fbee45eb46d5ab05002
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Jan 29 21:48:34 2016 -0800

    devm_memremap_pages: fix vmem_altmap lifetime + alignment handling
    
    to_vmem_altmap() needs to return valid results until
    arch_remove_memory() completes.  It also needs to be valid for any pfn
    in a section regardless of whether that pfn maps to data.  This escape
    was a result of a bug in the unit test.
    
    The signature of this bug is that free_pagetable() fails to retrieve a
    vmem_altmap and goes off into the weeds:
    
     BUG: unable to handle kernel NULL pointer dereference at           (null)
     IP: [<ffffffff811d2629>] get_pfnblock_flags_mask+0x49/0x60
     [..]
     Call Trace:
      [<ffffffff811d3477>] free_hot_cold_page+0x97/0x1d0
      [<ffffffff811d367a>] __free_pages+0x2a/0x40
      [<ffffffff8191e669>] free_pagetable+0x8c/0xd4
      [<ffffffff8191ef4e>] remove_pagetable+0x37a/0x808
      [<ffffffff8191b210>] vmemmap_free+0x10/0x20
    
    Fixes: 4b94ffdc4163 ("x86, mm: introduce vmem_altmap to augment vmemmap_populate()")
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Reported-by: Jeff Moyer <jmoyer@redhat.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 65f87ee71852a754f7981d0653e7136039b8798a
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Mon Jan 25 17:23:18 2016 -0800

    fs, block: force direct-I/O for dax-enabled block devices
    
    Similar to the file I/O path, re-direct all I/O to the DAX path for I/O
    to a block-device special file.  Both regular files and device special
    files can use the common filp->f_mapping->host lookup to determing is
    DAX is enabled.
    
    Otherwise, we confuse the DAX code that does not expect to find live
    data in the page cache:
    
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 7676 at mm/filemap.c:217
        __delete_from_page_cache+0x9f6/0xb60()
        Modules linked in:
        CPU: 0 PID: 7676 Comm: a.out Not tainted 4.4.0+ #276
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
         00000000ffffffff ffff88006d3f7738 ffffffff82999e2d 0000000000000000
         ffff8800620a0000 ffffffff86473d20 ffff88006d3f7778 ffffffff81352089
         ffffffff81658d36 ffffffff86473d20 00000000000000d9 ffffea0000009d60
        Call Trace:
         [<     inline     >] __dump_stack lib/dump_stack.c:15
         [<ffffffff82999e2d>] dump_stack+0x6f/0xa2 lib/dump_stack.c:50
         [<ffffffff81352089>] warn_slowpath_common+0xd9/0x140 kernel/panic.c:482
         [<ffffffff813522b9>] warn_slowpath_null+0x29/0x30 kernel/panic.c:515
         [<ffffffff81658d36>] __delete_from_page_cache+0x9f6/0xb60 mm/filemap.c:217
         [<ffffffff81658fb2>] delete_from_page_cache+0x112/0x200 mm/filemap.c:244
         [<ffffffff818af369>] __dax_fault+0x859/0x1800 fs/dax.c:487
         [<ffffffff8186f4f6>] blkdev_dax_fault+0x26/0x30 fs/block_dev.c:1730
         [<     inline     >] wp_pfn_shared mm/memory.c:2208
         [<ffffffff816e9145>] do_wp_page+0xc85/0x14f0 mm/memory.c:2307
         [<     inline     >] handle_pte_fault mm/memory.c:3323
         [<     inline     >] __handle_mm_fault mm/memory.c:3417
         [<ffffffff816ecec3>] handle_mm_fault+0x2483/0x4640 mm/memory.c:3446
         [<ffffffff8127eff6>] __do_page_fault+0x376/0x960 arch/x86/mm/fault.c:1238
         [<ffffffff8127f738>] trace_do_page_fault+0xe8/0x420 arch/x86/mm/fault.c:1331
         [<ffffffff812705c4>] do_async_page_fault+0x14/0xd0 arch/x86/kernel/kvm.c:264
         [<ffffffff86338f78>] async_page_fault+0x28/0x30 arch/x86/entry/entry_64.S:986
         [<ffffffff86336c36>] entry_SYSCALL_64_fastpath+0x16/0x7a
        arch/x86/entry/entry_64.S:185
        ---[ end trace dae21e0f85f1f98c ]---
    
    Fixes: 5a023cdba50c ("block: enable dax for raw block devices")
    Reported-by: Dmitry Vyukov <dvyukov@google.com>
    Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
    Suggested-by: Jan Kara <jack@suse.cz>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Suggested-by: Matthew Wilcox <willy@linux.intel.com>
    Tested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 9f4736fe7ca804aa79b5916221bb13dfc6221a0f
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Thu Jan 28 20:13:39 2016 -0800

    block: revert runtime dax control of the raw block device
    
    Dynamically enabling DAX requires that the page cache first be flushed
    and invalidated.  This must occur atomically with the change of DAX mode
    otherwise we confuse the fsync/msync tracking and violate data
    durability guarantees.  Eliminate the possibilty of DAX-disabled to
    DAX-enabled transitions for now and revisit this for the next cycle.
    
    Cc: Jan Kara <jack@suse.com>
    Cc: Jeff Moyer <jmoyer@redhat.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Matthew Wilcox <willy@linux.intel.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit d1a5f2b4d8a125943dcb6b032fc7eaefc2c78296
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Thu Jan 28 20:25:31 2016 -0800

    block: use DAX for partition table reads
    
    Avoid populating pagecache when the block device is in DAX mode.
    Otherwise these page cache entries collide with the fsync/msync
    implementation and break data durability guarantees.
    
    Cc: Jan Kara <jack@suse.com>
    Cc: Jeff Moyer <jmoyer@redhat.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
    Tested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
    Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 03fc2da63b9a33dce784a2075c7e068bb97cbf69
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Tue Jan 26 09:48:05 2016 -0800

    mm: fix pfn_t to page conversion in vm_insert_mixed
    
    pfn_t_to_page() honors the flags in the pfn_t value to determine if a
    pfn is backed by a page.  However, vm_insert_mixed() was originally
    written to use pfn_valid() to make this determination.  To restore the
    old/correct behavior, ignore the pfn_t flags in the !pfn_t_devmap() case
    and fallback to trusting pfn_valid().
    
    Fixes: 01c8f1c44b83 ("mm, dax, gpu: convert vm_insert_mixed to pfn_t")
    Cc: Dave Hansen <dave@sr71.net>
    Cc: David Airlie <airlied@linux.ie>
    Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 76e9f0ee52b0be5761e29847e0ef01f23f24f1df
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Jan 22 09:43:28 2016 -0800

    phys_to_pfn_t: use phys_addr_t
    
    A dma_addr_t is potentially smaller than a phys_addr_t on some archs.
    Don't truncate the address when doing the pfn conversion.
    
    Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
    Reported-by: Matthew Wilcox <willy@linux.intel.com>
    [willy: fix pfn_t_to_phys as well]
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

\
 
 \ /
  Last update: 2016-01-31 21:01    [W:2.094 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site