Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3833618rwl; Mon, 27 Mar 2023 21:38:39 -0700 (PDT) X-Google-Smtp-Source: AK7set9Kt4RrcjVKEgwSSg+ExGUCHtv/qZNzZHORuOs4QXNMalk5u46x283N2tCUYQ4yrastv7iy X-Received: by 2002:a05:6a20:7a9a:b0:d0:76e3:16ec with SMTP id u26-20020a056a207a9a00b000d076e316ecmr13053380pzh.13.1679978319150; Mon, 27 Mar 2023 21:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679978319; cv=none; d=google.com; s=arc-20160816; b=KdZItUf1koUQ+ctIJoHSRFy6+RkjDrIxJIdV73s53xmJkjEJ/IgjqaKCyfzoIDIC4C YcVc5ItnZSG+aJXXf1kstL/WlTpa1VBzLtsn0ftUSI326+5cQdR7h0CLOIH5QJKxw6a0 jaCVJErs4C9d8+JQa9/dwb3FbPPF0pK/o49InB1xCZ8caLN6BQA+DmgTu7sPocTuChFH Nx3W9GkQUO04xqO/eqLM/ylgALuZyKWCVY3E2dhWr9YSfZjvsUt427wtdHqvclE2t27r t507eB93bKHF/j8dVmZ5xHlSmAo6Dd9skrKCVmoBk7nCxwTtTCN+ji4JesPe6RKg+sGt tLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:subject:cc:to:from:date :feedback-id:dkim-signature:dkim-signature; bh=YFsPFLauCP2npAFrNKe9MFZyh5jEPM6xMMf0mm2s/GE=; b=A+DIyr39joyBRNqOu4QZyQmMFCer7szCL+R6Ispghd9sV7hVsMkNkC3Vl46TRdpNl/ J96Pt02cHF98EQ2uwdh1JCUSOXiX7/EBFscRYFyHzw9QfC6kit/MmBrIsOEGfh3G+oms Rorv8e6nyCBu2cw8GqjqgTXU/QZJQSxL/gFUGy2YN//OG21oRYh7spFcEmeEuSg6n0iV TkKMXyvn5GhaWMYKk35LsIhtcTur2c7rUobtCSryGIuQhvy9dB+g9G44BVKIMIsRAi2T TaNPKi6DqimZi8XZOaDrl/bFvCc6Hh7AO/oIFP/dZ1HFxG5vXeSg7O0Ktaos7a/tkd1u 9ShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joshtriplett.org header.s=fm1 header.b=GK8iFkd3; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=G0d6H0eV; 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 r20-20020a6560d4000000b004fba0f483c8si28508522pgv.185.2023.03.27.21.38.27; Mon, 27 Mar 2023 21:38:39 -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=GK8iFkd3; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=G0d6H0eV; 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 S232278AbjC1EAz (ORCPT + 99 others); Tue, 28 Mar 2023 00:00:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjC1EAx (ORCPT ); Tue, 28 Mar 2023 00:00:53 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA69BC7; Mon, 27 Mar 2023 21:00:51 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 0E2A13200319; Tue, 28 Mar 2023 00:00:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 28 Mar 2023 00:00: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=1679976050; x=1680062450; bh=YFsPFLauCP 2npAFrNKe9MFZyh5jEPM6xMMf0mm2s/GE=; b=GK8iFkd3jMCVykpBSWQcF5wTWD O+MbKI68pAa5puHLovUD42GpZasIzZfLKVXW7/LYB3MvmNWBB2Pmpx5OiXhikzss 8dZ17Ifzpg3vl6R2lNV+UjPvGn2EpVjwXFeF1PownZiCMvkF9JwWgAwpzWDpaxdn /6Xuc4mOWlpMZqAJlO/vsDFu4cLQ33lDcZh//9FEiaoSTN4JECW7CclmBS2Mc9lK G8AyzwRvCpR7/Z795p69vp/wF+M/8WZ80OpCkC9E3LMzpqfDVLcedD6lK3ieIEPD BDBsu2nmjoEYXxxY05mR4FO1iNRxlI88KTPsbjSmzE1EtkVHR5megQ05C/IA== 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= 1679976050; x=1680062450; bh=YFsPFLauCP2npAFrNKe9MFZyh5jEPM6xMMf 0mm2s/GE=; b=G0d6H0eVM3KSvqw8J3H5dETBzF0Ly9fkQ2APsClCiOA3Xl+cEfB xxzVNAcV0yrP2xWkbp3rd5oabhsZ8zrrdigT0PObwDvGoHMA4N+Gddrafa8ve0AD vzUHyBGMKe1FqRb42qd1e5m0t64j6Be6bC+ZbQFsjoqV1gmw8Ab38QEv1A3E7Qm3 Xun2015gd5Nmy9lpXCkdr0t8Oq9U13sit1v7he8Ab2901qvX9eHt+NqdRX1ff83w AhhWIUc88llQ3myjBzXuQKD0sz7uwdNOmCEaZSBEpdwgSpPBxzqPQP3KMwaQITVp iG0nz6EGv3Fyiaomxxs4cig7VkIXIBvnN/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehfedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevufgjfhfkgggtgfesthhqmhdttddtjeenucfhrhhomheplfhoshhh ucfvrhhiphhlvghtthcuoehjohhshhesjhhoshhhthhrihhplhgvthhtrdhorhhgqeenuc ggtffrrghtthgvrhhnpeegkeeggfegjedtvdehgfdtvdekueetveetfedvveetueetffek ieekledthfeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehjohhshhesjhhoshhhthhrihhplhgvthhtrdhorhhg X-ME-Proxy: Feedback-ID: i83e94755:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Mar 2023 00:00:48 -0400 (EDT) Date: Tue, 28 Mar 2023 13:00:30 +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 In-Reply-To: References: <20230320071442.172228-1-pedro.falcato@gmail.com> <20230320115153.7n5cq4wl2hmcbndf@wittgenstein> Message-ID: <1CBD903C-C417-42F4-9515-551041BF6CEF@joshtriplett.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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,RCVD_IN_MSPIKE_H2, 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 March 28, 2023 12:32:59 PM GMT+09:00, Linus Torvalds wrote: >Ok, just to play along - maybe you can make it slightly less >nonsensical by throwing O_PATH into the mix, and now an empty >directory file descriptor at least has *some* use=2E That's the case I was thinking of: create a directory, then use exclusivel= y *at system calls, never anything path-based=2E (I was using "atomic" loos= ely; not concerned about races here, just convenience=2E) >Now your code would not only be specific to Linux, it would be >specific to some very new version of Linux, and do something >completely different on older versions=2E I'm extremely not concerned with depending on current Linux=2E But that sa= id=2E=2E=2E >Because those older versions will do random things, ranging from >"always return an error" to "create a regular file - not a directory - >and then return an error anyway" and finally "create a regular file - >not a directory - and return that resulting fd"=2E =2E=2E=2E Right, open has the un-extendable semantics, hence O_TMPFILE=2E = Fair enough=2E Nevermind then=2E As is often the case for multi-operation syscalls, I'm better off just usi= ng io_uring for a mkdir-then-open=2E