From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935022AbdBQUv3 (ORCPT ); Fri, 17 Feb 2017 15:51:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59666 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbdBQUv1 (ORCPT ); Fri, 17 Feb 2017 15:51:27 -0500 Date: Fri, 17 Feb 2017 21:51:24 +0100 From: Andrea Arcangeli To: Andrew Morton Cc: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport , "Dr. David Alan Gilbert" , Hillf Danton , Pavel Emelyanov , "Kirill A. Shutemov" Subject: Re: [PATCH] userfaultfd: hugetlbfs: add UFFDIO_COPY support for shared mappings Message-ID: <20170217205124.GV25530@redhat.com> References: <1487195210-12839-1-git-send-email-mike.kravetz@oracle.com> <20170216184100.GS25530@redhat.com> <20170217155241.GT25530@redhat.com> <20170217121738.f5b2e24474021f38fdb72845@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170217121738.f5b2e24474021f38fdb72845@linux-foundation.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 17 Feb 2017 20:51:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2017 at 12:17:38PM -0800, Andrew Morton wrote: > I merged this up and a small issue remains: Great! > The value of `err' here is EINVAL. That sems appropriate, but it only > happens by sheer luck. It might have been programmer luck but just for completeness, at runtime no luck was needed (the temporary setting to ENOENT is undoed before the if clause is closed). Your addition is surely safer just in case of future changes missing how we inherited the EINVAL in both branches, thanks! (plus the compiler should be able to optimize it away until after it will be needed)