diff options
author | Mark Brown <broonie@kernel.org> | 2018-12-14 11:11:33 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-14 11:11:33 +0000 |
commit | 5f783fd0a840588ca62b9f658d306277c7127229 (patch) | |
tree | acc2d5d7d33801ce8478e308a08acef7353b4afe /mm | |
parent | 684d5e05df8cdc18791e76b11f6bc85ecd4d9416 (diff) | |
parent | 640f85865ca658ae07d485693a3d452bdbbadaba (diff) |
Merge tag 'v4.4.167' into linux-linaro-lsk-v4.4
This is the 4.4.167 stable release
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mlock.c | 3 | ||||
-rw-r--r-- | mm/truncate.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index 9d2e773f3a95..b03f160c1bdd 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -504,6 +504,7 @@ static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev, int nr_pages; int ret = 0; int lock = !!(newflags & VM_LOCKED); + vm_flags_t old_flags = vma->vm_flags; if (newflags == vma->vm_flags || (vma->vm_flags & VM_SPECIAL) || is_vm_hugetlb_page(vma) || vma == get_gate_vma(current->mm)) @@ -538,6 +539,8 @@ success: nr_pages = (end - start) >> PAGE_SHIFT; if (!lock) nr_pages = -nr_pages; + else if (old_flags & VM_LOCKED) + nr_pages = 0; mm->locked_vm += nr_pages; /* diff --git a/mm/truncate.c b/mm/truncate.c index f4c8270f7b84..aeb1adba329e 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -432,9 +432,13 @@ void truncate_inode_pages_final(struct address_space *mapping) */ spin_lock_irq(&mapping->tree_lock); spin_unlock_irq(&mapping->tree_lock); - - truncate_inode_pages(mapping, 0); } + + /* + * Cleancache needs notification even if there are no pages or shadow + * entries. + */ + truncate_inode_pages(mapping, 0); } EXPORT_SYMBOL(truncate_inode_pages_final); |