userfaultfd: non-cooperative: dup_userfaultfd: use mm_count instead of mm_users
authorMike Rapoport <[email protected]>
Wed, 22 Feb 2017 23:42:30 +0000 (15:42 -0800)
committerLinus Torvalds <[email protected]>
Thu, 23 Feb 2017 00:41:28 +0000 (16:41 -0800)
Since commit d2005e3f41d4 ("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]>
fs/userfaultfd.c

index 6046e0b552b24d4d1808dfa1c52470ea9fdc70ee..27978f249016f80eb1dbe2c0037e9cc9022d2d4f 100644 (file)
@@ -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;