diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-05 11:32:11 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-05 11:32:11 +0900 |
commit | cde357c392e93aa7fcfc019403e0d1792081d634 (patch) | |
tree | 7d137cd4868622599fca7b4f80cb243432eef58d /fs/dax.c | |
parent | 2cd7cdc7e420a343743db781484e801fd784a1f1 (diff) | |
parent | 1571c029a2ff289683ddb0a32253850363bcb8a7 (diff) |
Merge tag 'dax-fix-5.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull dax fix from Dan Williams:
"A single dax fix that has been soaking awaiting other fixes under
discussion to join it. As it is getting late in the cycle lets proceed
with this fix and save follow-on changes for post-v5.3-rc1.
- Fix xarray entry association for mixed mappings"
* tag 'dax-fix-5.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
dax: Fix xarray entry association for mixed mappings
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -720,12 +720,11 @@ static void *dax_insert_entry(struct xa_state *xas, xas_reset(xas); xas_lock_irq(xas); - if (dax_entry_size(entry) != dax_entry_size(new_entry)) { + if (dax_is_zero_entry(entry) || dax_is_empty_entry(entry)) { + void *old; + dax_disassociate_entry(entry, mapping, false); dax_associate_entry(new_entry, mapping, vmf->vma, vmf->address); - } - - if (dax_is_zero_entry(entry) || dax_is_empty_entry(entry)) { /* * Only swap our new entry into the page cache if the current * entry is a zero page or an empty entry. If a normal PTE or @@ -734,7 +733,7 @@ static void *dax_insert_entry(struct xa_state *xas, * existing entry is a PMD, we will just leave the PMD in the * tree and dirty it if necessary. */ - void *old = dax_lock_entry(xas, new_entry); + old = dax_lock_entry(xas, new_entry); WARN_ON_ONCE(old != xa_mk_value(xa_to_value(entry) | DAX_LOCKED)); entry = new_entry; |