Received: by 10.223.164.202 with SMTP id h10csp3598764wrb; Mon, 20 Nov 2017 01:46:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMb/qO8NBi3qdIqWXgKTx4R4P+NIRwd7bSxQtL2aG4ycHRIuY1YAb/913UXd6/jFgj3fEEFa X-Received: by 10.84.248.77 with SMTP id e13mr13577887pln.200.1511171210827; Mon, 20 Nov 2017 01:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511171210; cv=none; d=google.com; s=arc-20160816; b=HanwvrO4c4FyAxd09ahz5wyU3h9L7E88p0dgmaqxJHZ1kEtxbRFLO2kejPC6WwcR4I P7wcNqp+eXnG9LXbQUHpUZP26VSjiU+h0JKaGVNZlrMIvHL0IQFb7eXMdcH6oqmyzCxz DIch4E6vT1Jso7NrWorkTPYnu/m8iGFK66BXMbjDUoR7IiCR24dzp4hHyiInVya765Dz Ma5TDvTP22Txuny0NBkh731rjfYW7kwY2L/phSIbA2DHh8Tzayea2e2f6TuBgS/d3nXW fQrACjgalItegQxIh5w7JUrqQ9c8MSmgc2SqS27K7/Si1cV+YLrgs9KzgIfcRTE9CJxW iOTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=C+nhjhjn5SM59EKD6Wsm0ORqaDcRlPHcVGJQWp0znHk=; b=f+VRnU4tBQAAUV08ciVBR5V3/oOF4hgD6QaAw5Q1t+2LObVFgF0i6O5fv3FMPcLhMC eW+esMlMJTCcVmd++BUfnIC+VEbqBfoQEwsG/ziJK2dFJhdQtgJ2llnsPMxQhfCrAbqw a3E7lmyw5p0XOXbnVi6A7XtR3lcANCnNJ+war5uEJCSO6DioQkqC1OqcXokSgoakCu3W vYlUJgyxIHi7rwC/X6HFVczzrIAiB3RH9mwhQNBupNMFz+GV7/GaYf+QBDSrJvJ56JHA yU5I6GmNFLsGhutoT3iSHTKVbWsBS+jtXo19rCSmj6sEsQpUdjRw/zsGiAeguucdew5L mHIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si4867139plk.259.2017.11.20.01.46.40; Mon, 20 Nov 2017 01:46:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075AbdKTJqB (ORCPT + 68 others); Mon, 20 Nov 2017 04:46:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdKTJqA (ORCPT ); Mon, 20 Nov 2017 04:46:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2992C2D1EDC; Mon, 20 Nov 2017 09:46:00 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-106.ams2.redhat.com [10.36.116.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5CEF4145; Mon, 20 Nov 2017 09:45:57 +0000 (UTC) Subject: Re: [RFC PATCH 1/2] mm: introduce MAP_FIXED_SAFE To: Michal Hocko Cc: linux-api@vger.kernel.org, Khalid Aziz , Michael Ellerman , Andrew Morton , Russell King - ARM Linux , Andrea Arcangeli , linux-mm@kvack.org, LKML , linux-arch@vger.kernel.org References: <20171116101900.13621-1-mhocko@kernel.org> <20171116101900.13621-2-mhocko@kernel.org> <20171120085524.y4onsl5dpd3qbh7y@dhcp22.suse.cz> <37a6e9ba-e0df-b65f-d5ef-871c25b5cb87@redhat.com> <20171120093309.wobvu6mixbk75m3v@dhcp22.suse.cz> From: Florian Weimer Message-ID: Date: Mon, 20 Nov 2017 10:45:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171120093309.wobvu6mixbk75m3v@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 Nov 2017 09:46:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/20/2017 10:33 AM, Michal Hocko wrote: > On Mon 20-11-17 10:10:32, Florian Weimer wrote: >> On 11/20/2017 09:55 AM, Michal Hocko wrote: >>> On Fri 17-11-17 08:30:48, Florian Weimer wrote: >>>> On 11/16/2017 11:18 AM, Michal Hocko wrote: >>>>> + if (flags & MAP_FIXED_SAFE) { >>>>> + struct vm_area_struct *vma = find_vma(mm, addr); >>>>> + >>>>> + if (vma && vma->vm_start <= addr) >>>>> + return -ENOMEM; >>>>> + } >>>> >>>> Could you pick a different error code which cannot also be caused by a an >>>> unrelated, possibly temporary condition? Maybe EBUSY or EEXIST? >>> >>> Hmm, none of those are described in the man page. I am usually very >>> careful to not add new and potentially unexpected error codes but it is >> >> I think this is a bad idea. It leads to bizarre behavior, like open failing >> with EOVERFLOW with certain namespace configurations (which have nothing to >> do with file sizes). > > Ohh, I agree but breaking userspace is, you know, no-no. And an > unexpected error codes can break things terribly. On the glibc side, we see a lot of changes in error codes depending on kernel version, build and run-time configuration. It never occurred to me that you guys think the precise error code is part of the userspace ABI. Personally, I even assume that failure itself can disappear at any time (evidence: the f* functions which accept O_PATH in their non-*at variants). Thanks, Florian From 1584577059628177285@xxx Mon Nov 20 09:34:04 +0000 2017 X-GM-THRID: 1584222568854832887 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread