Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103AbdIRBxJ (ORCPT ); Sun, 17 Sep 2017 21:53:09 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:50822 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbdIRBxH (ORCPT ); Sun, 17 Sep 2017 21:53:07 -0400 X-Google-Smtp-Source: AOwi7QA5kpmnjFUpWgiwordYuwBebVny07CgsBn2U9bf4go8tOHi6WLtYhXi+KoWXJx2ElLzpPisGpANuqQ2MCycvXQ= MIME-Version: 1.0 In-Reply-To: <20170915213745.6821-1-mike.kravetz@oracle.com> References: <20170915213745.6821-1-mike.kravetz@oracle.com> From: Jann Horn Date: Sun, 17 Sep 2017 18:52:46 -0700 Message-ID: Subject: Re: [patch] mremap.2: Add description of old_size == 0 functionality To: Mike Kravetz 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 870 Lines: 26 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"?