Skip to content

Commit

Permalink
userfaultfd: non-cooperative: dup_userfaultfd: use mm_count instead o…
Browse files Browse the repository at this point in the history
…f mm_users

Since commit d2005e3 ("userfaultfd: don't pin the user memory in
userfaultfd_file_create()") userfaultfd uses mm_count rather than
mm_users to pin mm_struct.

Make dup_userfaultfd consistent with this behaviour

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Signed-off-by: Andrea Arcangeli <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: Michael Rapoport <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rppt authored and torvalds committed Feb 23, 2017
1 parent 893e26e commit d3aadc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/userfaultfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs)
ctx->features = octx->features;
ctx->released = false;
ctx->mm = vma->vm_mm;
atomic_inc(&ctx->mm->mm_users);
atomic_inc(&ctx->mm->mm_count);

userfaultfd_ctx_get(octx);
fctx->orig = octx;
Expand Down

0 comments on commit d3aadc8

Please sign in to comment.