From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2F19C76195 for ; Tue, 28 Mar 2023 02:15:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232183AbjC1CP6 (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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