All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] userfaultfd_copy-return-enospc-in-case-mm-has-gone.patch removed from -mm tree
@ 2017-02-27 20:26 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-02-27 20:26 UTC (permalink / raw)
  To: rppt, aarcange, dgilbert, hillf.zj, mike.kravetz, xemul, mm-commits


The patch titled
     Subject: userfaultfd_copy: return -ENOSPC in case mm has gone
has been removed from the -mm tree.  Its filename was
     userfaultfd_copy-return-enospc-in-case-mm-has-gone.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: userfaultfd_copy: return -ENOSPC in case mm has gone

In the non-cooperative userfaultfd case, the process exit may race with
outstanding mcopy_atomic called by the uffd monitor.  Returning -ENOSPC
instead of -EINVAL when mm is already gone will allow uffd monitor to
distinguish this case from other error conditions.

Link: http://lkml.kernel.org/r/1485542673-24387-6-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/userfaultfd.c |    2 ++
 1 file changed, 2 insertions(+)

diff -puN fs/userfaultfd.c~userfaultfd_copy-return-enospc-in-case-mm-has-gone fs/userfaultfd.c
--- a/fs/userfaultfd.c~userfaultfd_copy-return-enospc-in-case-mm-has-gone
+++ a/fs/userfaultfd.c
@@ -1607,6 +1607,8 @@ static int userfaultfd_copy(struct userf
 		ret = mcopy_atomic(ctx->mm, uffdio_copy.dst, uffdio_copy.src,
 				   uffdio_copy.len);
 		mmput(ctx->mm);
+	} else {
+		return -ENOSPC;
 	}
 	if (unlikely(put_user(ret, &user_uffdio_copy->copy)))
 		return -EFAULT;
_

Patches currently in -mm which might be from rppt@linux.vnet.ibm.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-27 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 20:26 [merged] userfaultfd_copy-return-enospc-in-case-mm-has-gone.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.