summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2019-01-08 12:15:40 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2019-01-09 08:23:55 +1100
commit8ac5360b9a97b3b4cd41d248800adf7bd02c1104 (patch)
treea4e99e13bc56cbcebf33c803d72d6626118b24de
parentabbf5492b583c9ea053cfdc2d38f6dddc0896df7 (diff)
downloadlinux-8ac5360b9a97b3b4cd41d248800adf7bd02c1104.tar.gz
linux-8ac5360b9a97b3b4cd41d248800adf7bd02c1104.tar.xz
filemap-drop-the-mmap_sem-for-all-blocking-operations-fix
Here's a fixup for "filemap: drop the mmap_sem for all blocking operations". do_sync_mmap_readahead() drops mmap_sem now, so by the time of dereferencing vmf->vma for count_memcg_event_mm() the VMA can be gone. Link: http://lkml.kernel.org/r/20181228235106.okk3oastsnpxusxs@kshutemo-mobl1 Cc: Josef Bacik <josef@toxicpanda.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Dave Chinner <david@fromorbit.com> Cc: Jan Kara <jack@suse.cz> Cc: Rik van Riel <riel@redhat.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--mm/filemap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index b295e8066559..885708acedfb 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2553,10 +2553,10 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
fpin = do_async_mmap_readahead(vmf, page);
} else if (!page) {
/* No page in the page cache at all */
- fpin = do_sync_mmap_readahead(vmf);
count_vm_event(PGMAJFAULT);
count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT);
ret = VM_FAULT_MAJOR;
+ fpin = do_sync_mmap_readahead(vmf);
retry_find:
page = pagecache_get_page(mapping, offset,
FGP_CREAT|FGP_FOR_MMAP,