Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6834eced authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: Icab68d33d514d951d7ef17d43358d783ecfe99f8
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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Git-Commit: f547fff5b0e248f9b40a2d63b5e1fbbfc99e5515
Git-Repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git


Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
parent 48f8cb52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2457,10 +2457,10 @@ int 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,