Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3723573rwl; Mon, 27 Mar 2023 19:19:51 -0700 (PDT) X-Google-Smtp-Source: AKy350aX8Wd2bXqBX3MJBX/NYQPmTnp4U8gIsXJYb2IrsuyEL4kb7DaOTPUPtE3jjejx8e+XhydG X-Received: by 2002:a62:4e4e:0:b0:626:166f:6db1 with SMTP id c75-20020a624e4e000000b00626166f6db1mr13330186pfb.13.1679969991200; Mon, 27 Mar 2023 19:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679969991; cv=none; d=google.com; s=arc-20160816; b=Rryq4VD7KQ5To3CxaOFLwh2Q+tucV/DC4QCtsz4Y5YUiFQLjD8yReEKz2/aKrJ3SvE elSdf5mJrzWzXaA7zFjODRdCbPq3XfGNPs/IgUwbKmvINlPgAaKv+ityzbekSEa9S8/v 0C177z/hq5QAWHi960HTcS2JXXKJ5UBzNPdDN3xVZCyZq0msgoxy86X6sReZcCBweIti r5UvjLx6Of8b7wH2VT9fK4JHfjmJ7QUx5jgk4c8HRQ22ojpw6U8MHUmtDr7yVFCX0Gpd upWBBUT4jsA//zIaIIYkBfbxEi68aNscs/enzCWk4eJDoPZUYaFXYNjAc5KWBgBL5KIP 4FMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=VSoRs4qx31DQtHX69enCiD9vEWuY3FDOWU9BPyRADKQ=; b=qRZg8YWBxZMxU6QBBrZGwF1fLtYvXHAY9853V8QR2LKVLMZ5iDHsNRN/d20ZM/V41N FXmGYjP3juXP6wLFl0TVQ/Nkqbksb+Z5NuZ8s++gd/B2O8OW22CvEFqoU9td7jQSahNf TqBmjI/uSrYT/o5Qn8sHoPthEnDYcx7+DGZyP/zhltpXR9qO4TJSsMgTUjn1AWxeK0nV IM+Y/mVlPYJE5kLilrzMq/wV0+uwWcaQsssJ6GS282Ldq+WrOxO+A3obCLwjUx0yoJu7 MGjhuMmwQZ/39mS6wtWXGe0kAQs2+8OlTRUFLuvrDZV4DgGwP4mRXGUWm8c4HEuNwQcT l9Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joshtriplett.org header.s=fm1 header.b=pCSi51z7; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=IvmlCEWA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a056a0010cb00b005a6344ba496si28681494pfu.239.2023.03.27.19.19.39; Mon, 27 Mar 2023 19:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joshtriplett.org header.s=fm1 header.b=pCSi51z7; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=IvmlCEWA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232400AbjC1CP6 (ORCPT + 99 others); Mon, 27 Mar 2023 22:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjC1CPz (ORCPT ); Mon, 27 Mar 2023 22:15:55 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3BF26A2; Mon, 27 Mar 2023 19:15:53 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 2EB55320024A; Mon, 27 Mar 2023 22:15:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 27 Mar 2023 22:15:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= joshtriplett.org; h=cc:cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1679969750; x=1680056150; bh=VSoRs4qx31 DQtHX69enCiD9vEWuY3FDOWU9BPyRADKQ=; b=pCSi51z70vfQIiYPF5Z2HW2KIV wgdN8H2gqjkHakQc6TFWUcoZTlCahT+CIy0+eMf0v0mdaqY1QgibuREKwJko419G G/138jn6znYMEvLBp4qFGMO+Pxj9yuktt8grhXyNCLjuKEpQna/4FJCeoyQxTKqI ymTyGoZxWLicwZVkFOFDXGf1n1xa0ov35/G5IHr6d3/w2bPC4JDXMthIk9SdslI7 ntrE7zxuVbRIQSnMwmOv7qj7h/T58ahBi43PsslLphRF3H93RgViSHxzab424yJS 4qAJtcdo9HXlZsuqnsYBTH6XWkpjzlXGiajgF0T2hZvbdeRhZmsNkzmw+y3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679969750; x=1680056150; bh=VSoRs4qx31DQtHX69enCiD9vEWuY3FDOWU9 BPyRADKQ=; b=IvmlCEWAfUTMyy+re14E5OJOlIckx+q1aRHrEtm9Yvxe4PW1uYx ZyB/4SioVTlWZQTgUHEW7yZTR6BfdFwgLPiowT/NIcQjhh2jj2iQDvyVnDXUUXdJ bbqP5P8pE1XpgQx1XPkCkIagwl3lDpQFGclO5nHro55Hik6yKqYsmQ7hK2k+iOdk OVCu1eVJz2QVSQ3/5ilLiNvXys/SHf9B+548a+ca5xg6d1NIdzHLWoo4ExNd/TOc AMrWNF8GZGq8oGelz5cjurXBPBFrCVhQF9LnZhzHsr4gACspDni+gzpKn1FPT5Q+ IeIdeuvTI3quhY0OAH/XoIKmbj2aW/Xs+Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehfedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeflohhs hhcuvfhrihhplhgvthhtuceojhhoshhhsehjohhshhhtrhhiphhlvghtthdrohhrgheqne cuggftrfgrthhtvghrnhepgeeihfevvdeklefggfejjeeugfduudeggffhjeehkeegheel tddujeffjeekheefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhoshhhsehjohhshhhtrhhiphhlvghtthdrohhrgh X-ME-Proxy: Feedback-ID: i83e94755:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Mar 2023 22:15:48 -0400 (EDT) Date: Tue, 28 Mar 2023 11:15:45 +0900 From: Josh Triplett To: Linus Torvalds Cc: Christian Brauner , Pedro Falcato , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] do_open(): Fix O_DIRECTORY | O_CREAT behavior Message-ID: References: <20230320071442.172228-1-pedro.falcato@gmail.com> <20230320115153.7n5cq4wl2hmcbndf@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2023 at 10:14:29AM -0700, Linus Torvalds wrote: > On Mon, Mar 20, 2023 at 4:52 AM Christian Brauner wrote: > > > > So before we continue down that road should we maybe treat this as a > > chance to fix the old bug? Because this behavior of returning -ENOTDIR > > has existed ever since v5.7 now. Since that time we had three LTS > > releases all returning ENOTDIR even if the file was created. > > Ack. > > I think considering that the return value has been broken for so long, > I think we can pretty much assume that there are no actual users of > it, and we might as well clean up the semantics properly. If there are no users of this and we can clean up the semantics, is there a strong reason *not* to make `O_DIRECTORY | O_CREATE` actually create a directory and atomically return a file descriptor for that directory? That seems like genuinely useful behavior that we don't currently have a syscall for. I didn't see any suggestion in the thread for reasons why we can't or shouldn't do that. Would that break some existing software? It doesn't *sound* like it would. As far as I can tell, that *also* wouldn't cause a problem with O_TMPFILE, because older kernels will still fail as desired, and we wouldn't change the behavior of O_TMPFILE on new kernels (it'd still create a temporary file, not a directory). - Josh Triplett