On Tue, Jul 25, 2017 at 12:47:42AM -0400, Prakash Sangappa wrote:
Signed-off-by: Prakash Sangappa <prakash.sangappa@xxxxxxxxxx>Like Mike said, some comment about the test would be better, commit
---
tools/testing/selftests/vm/userfaultfd.c | 121 +++++++++++++++++++++++++++++-
1 files changed, 118 insertions(+), 3 deletions(-)
messages are never one liners in the kernel.
@@ -408,6 +409,7 @@ static int copy_page(int ufd, unsigned long offset)Isn't this fd leak bugfix independent of the rest of the changes? The
userfaults++;
break;
case UFFD_EVENT_FORK:
+ close(uffd);
uffd = msg.arg.fork.ufd;
pollfd[0].fd = uffd;
break;
only side effects should have been that it could run out of fds, but I
assume this was found by source review as I doubt it could run out of fds.
This could be splitted off in a separate patch.
Overall it looks a good test also exercising UFFD_EVENT_FORK at the
same time.
Thanks,
Andrea