Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093AbdIRRWM (ORCPT ); Mon, 18 Sep 2017 13:22:12 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:18319 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932903AbdIRRWK (ORCPT ); Mon, 18 Sep 2017 13:22:10 -0400 Subject: Re: [patch] mremap.2: Add description of old_size == 0 functionality To: Jann Horn Cc: Michael Kerrisk-manpages , linux-man@vger.kernel.org, kernel list , Linux API , Michal Hocko , Andrea Arcangeli , "Kirill A . Shutemov" , Vlastimil Babka , Anshuman Khandual , linux-mm@kvack.org References: <20170915213745.6821-1-mike.kravetz@oracle.com> From: Mike Kravetz Message-ID: <2d4ea731-5b8d-0aac-b5aa-57ff2d3d907a@oracle.com> Date: Mon, 18 Sep 2017 10:19:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1142 Lines: 37 On 09/17/2017 06:52 PM, Jann Horn wrote: > On Fri, Sep 15, 2017 at 2:37 PM, Mike Kravetz wrote: > [...] >> A recent change was made to mremap so that an attempt to create a >> duplicate a private mapping will fail. >> >> commit dba58d3b8c5045ad89c1c95d33d01451e3964db7 >> Author: Mike Kravetz >> Date: Wed Sep 6 16:20:55 2017 -0700 >> >> mm/mremap: fail map duplication attempts for private mappings >> >> This return code is also documented here. > [...] >> diff --git a/man2/mremap.2 b/man2/mremap.2 > [...] >> @@ -174,7 +189,12 @@ and >> or >> .B MREMAP_FIXED >> was specified without also specifying >> -.BR MREMAP_MAYMOVE . >> +.BR MREMAP_MAYMOVE ; >> +or \fIold_size\fP was zero and \fIold_address\fP does not refer to a >> +private anonymous mapping; > > Shouldn't this be the other way around? "or old_size was zero and > old_address refers to a private anonymous mapping"? Thanks Jann, Yes that is wrong. In addition, the description of this functionality in the section before this is also incorrect. I will fix both in a new version of the patch. -- Mike Kravetz