From: Mike Rapoport Date: Thu, 16 Nov 2017 01:36:56 +0000 (-0800) Subject: userfaultfd: use mmgrab instead of open-coded increment of mm_count X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=00bb31fa44acf9591018810ff9d5ab375779c1cc;p=openwrt%2Fstaging%2Fblogic.git userfaultfd: use mmgrab instead of open-coded increment of mm_count Link: http://lkml.kernel.org/r/1508132478-7738-1-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport Cc: Andrea Arcangeli Cc: "Dr . David Alan Gilbert" Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index f46d133c0949..ac9a4e65ca49 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -668,7 +668,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_count); + mmgrab(ctx->mm); userfaultfd_ctx_get(octx); fctx->orig = octx;