From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:37598 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbeF1ESd (ORCPT ); Thu, 28 Jun 2018 00:18:33 -0400 Subject: Re: [PATCH] mm: reject MAP_SHARED_VALIDATE without new flags References: <60052659-7b37-cb69-bf9f-1683caa46219@redhat.com> <1e2ad827-6ff4-4b1e-c4d9-79ca4e432a6c@sandeen.net> From: Eric Sandeen Message-ID: <52d82353-2746-269a-c1e3-e4aec4fbf0f9@redhat.com> Date: Wed, 27 Jun 2018 23:18:30 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Linus Torvalds , Eric Sandeen Cc: linux-fsdevel , linux-mm , Linux API , linux-xfs , linux-ext4@vger.kernel.org, "linux-nvdimm@lists.01.org" , Dan Williams , Jan Kara , Christoph Hellwig , zhibli@redhat.com On 6/27/18 9:37 PM, Linus Torvalds wrote: > On Wed, Jun 27, 2018 at 7:17 PM Eric Sandeen wrote: >> >> What broke is that mmap(MAP_SHARED|MAP_PRIVATE) now succeeds without error, >> whereas before it rightly returned -EINVAL. > > You're still confusing *behavior* with breakage. > > Yes. New *behavior* is that MAP_SHARED|MAP_PRIVATE is now a valid > thing. It means "MAP_SHARED_VALIDATE". > > Behavior changed. That's normal. Every single time we add a system > call, behavior changes: a system call that used to return -ENOSYS now > returns something else. > > That's not breakage, that's just intentional new behavior. *shrug* semantics aside, the new behavior is out there in a public API, so I guess there's nothing to do at this point other than to document the change more clearly. It's true that my patch could possibly break existing users. The man page is clearly wrong at this point, both in terms of the error code section, and the claim that MAP_SHARED and MAP_PRIVATE behave as described in POSIX (because POSIX states that these two flags may not be specified together.) -Eric