Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbdGZO11 (ORCPT ); Wed, 26 Jul 2017 10:27:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdGZO1Z (ORCPT ); Wed, 26 Jul 2017 10:27:25 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4862EC058EDC Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=aarcange@redhat.com Date: Wed, 26 Jul 2017 16:27:23 +0200 From: Andrea Arcangeli To: Prakash Sangappa Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, rppt@linux.vnet.ibm.com, akpm@linux-foundation.org, mike.kravetz@oracle.com Subject: Re: [RESEND PATCH 2/2] userfaultfd: selftest: Add tests for UFFD_FREATURE_SIGBUS Message-ID: <20170726142723.GW29716@redhat.com> References: <1500958062-953846-1-git-send-email-prakash.sangappa@oracle.com> <1500958062-953846-3-git-send-email-prakash.sangappa@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500958062-953846-3-git-send-email-prakash.sangappa@oracle.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 26 Jul 2017 14:27:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 973 Lines: 28 On Tue, Jul 25, 2017 at 12:47:42AM -0400, Prakash Sangappa wrote: > Signed-off-by: Prakash Sangappa > --- > tools/testing/selftests/vm/userfaultfd.c | 121 +++++++++++++++++++++++++++++- > 1 files changed, 118 insertions(+), 3 deletions(-) Like Mike said, some comment about the test would be better, commit messages are never one liners in the kernel. > @@ -408,6 +409,7 @@ static int copy_page(int ufd, unsigned long offset) > userfaults++; > break; > case UFFD_EVENT_FORK: > + close(uffd); > uffd = msg.arg.fork.ufd; > pollfd[0].fd = uffd; > break; Isn't this fd leak bugfix independent of the rest of the changes? The 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