diff options
author | Matthew Wilcox <willy@infradead.org> | 2018-11-30 11:05:06 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-12-04 21:32:00 -0800 |
commit | 27359fd6e5f3c5db8fe544b63238b6170e8806d8 (patch) | |
tree | 1f6bd40a9fdc8f43c76b97fe4eb0fa309d9f61d7 /fs/internal.h | |
parent | 55e56f06ed71d9441f3abd5b1d3c1a870812b3fe (diff) | |
download | blackbird-obmc-linux-27359fd6e5f3c5db8fe544b63238b6170e8806d8.tar.gz blackbird-obmc-linux-27359fd6e5f3c5db8fe544b63238b6170e8806d8.zip |
dax: Fix unlock mismatch with updated API
Internal to dax_unlock_mapping_entry(), dax_unlock_entry() is used to
store a replacement entry in the Xarray at the given xas-index with the
DAX_LOCKED bit clear. When called, dax_unlock_entry() expects the unlocked
value of the entry relative to the current Xarray state to be specified.
In most contexts dax_unlock_entry() is operating in the same scope as
the matched dax_lock_entry(). However, in the dax_unlock_mapping_entry()
case the implementation needs to recall the original entry. In the case
where the original entry is a 'pmd' entry it is possible that the pfn
performed to do the lookup is misaligned to the value retrieved in the
Xarray.
Change the api to return the unlock cookie from dax_lock_page() and pass
it to dax_unlock_page(). This fixes a bug where dax_unlock_page() was
assuming that the page was PMD-aligned if the entry was a PMD entry with
signatures like:
WARNING: CPU: 38 PID: 1396 at fs/dax.c:340 dax_insert_entry+0x2b2/0x2d0
RIP: 0010:dax_insert_entry+0x2b2/0x2d0
[..]
Call Trace:
dax_iomap_pte_fault.isra.41+0x791/0xde0
ext4_dax_huge_fault+0x16f/0x1f0
? up_read+0x1c/0xa0
__do_fault+0x1f/0x160
__handle_mm_fault+0x1033/0x1490
handle_mm_fault+0x18b/0x3d0
Link: https://lkml.kernel.org/r/20181130154902.GL10377@bombadil.infradead.org
Fixes: 9f32d221301c ("dax: Convert dax_lock_mapping_entry to XArray")
Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/internal.h')
0 files changed, 0 insertions, 0 deletions