VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Linus Torvalds <torvalds@linux-foundation.org> 2016-03-01 11:56:22 -0800 committer: Linus Torvalds <torvalds@linux-foundation.org> 2016-03-02 09:03:18 -0800 commit: 39680f50ae54cbbb6e72ac38b8329dd3eb9105f4 parent: f691b77b1fc491dae601631c8531a0a13e915466
Commit Summary:
userfaultfd: don't block on the last VM updates at exit time
Diffstat:
1 file changed, 6 insertions, 0 deletions
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 50311703135b..66cdb44616d5 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -286,6 +286,12 @@ int handle_userfault(struct vm_area_struct *vma, unsigned long address,
 	if (unlikely(ACCESS_ONCE(ctx->released)))
 		goto out;
 
+	/*
+	 * We don't do userfault handling for the final child pid update.
+	 */
+	if (current->flags & PF_EXITING)
+		goto out;
+
 	/*
 	 * Check that we can return VM_FAULT_RETRY.
 	 *