Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp122371lqj; Thu, 11 Apr 2024 11:34:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtHQYokPPlvFsfdVdZCPIzQqR3VfPzwa2/yIOJAI0lPv4vfWhSvVwukbZQ6cNelXwXlQjF/TxQi3wBp0GD58RFcOh0ztW32dx64xu1Jw== X-Google-Smtp-Source: AGHT+IFFSYq3uH37YpmMWO9vPcdgQYi8TOGR1FZZAFO4qDQBjKFBgkxV/0KKbCnWe4ZDUNauBtv9 X-Received: by 2002:a17:902:ce89:b0:1e5:10e5:b673 with SMTP id f9-20020a170902ce8900b001e510e5b673mr313084plg.37.1712860448366; Thu, 11 Apr 2024 11:34:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712860448; cv=pass; d=google.com; s=arc-20160816; b=Z69/telkil+o1f3WRvjlEjr4xFEfQ/gkfEhe6DwlCMyCU8wWhTksYxJZWQhaUiOKJ2 IzJDbz4zeg4WnQtwXPGeciRI2mveXxyAa2wUYzgqFu1sKm6ggYA+Wp/YksLBXfke1g1b /E3p1vr93iswr2KrXr8dcEYwa0vy05FhC7XkRYuxyCSj/zAzbifTxWlSWFpPIH7QZ92v fCmZYB3UzWM+jl6/4sj2vshUxn9bCfpzBjxlHuh3nZAuC5qJ0vbPvb0SlpeqVLRzHXbK mgU8b4B2jCL0fqmOPyfuK14XM16+ePnaOfAhbYj1p44PdkIJHOljQZ3ieyydFA60RleG +VzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=nb6qBOubwpr++hT5NYcUKi/PePjm+psMH2yQSPywASo=; fh=KCZMggVTW/jZix8Nd6JbDHE+5ipZZiVYaO0suUQcDeU=; b=QEHGa2I+gdTs37d21LkPzAMXPSErxKtjY7N0AvpcTc0nDgf75fKJ1Hm8vBZ7weiP2k f6KiR9AJ4D1XI2aZaJIfPyNd8xDe86y7ixOgd3+9OPVImiBDZr4sEiKtKRAvX3d4uGYj bBcj8KPos0rKiusBQU8fVvemE9J+eBy31I6D0DnDOnkVfNBIM5hvBdFGXgdxmAoYN62H 7FLSgwWUemDYRz8R0fvi9RW+Rb54pkNsEbQbe02IrsSVq/NBgZ5C96hGnHQR5H4h7m70 pbRSQCp7/qPOPv+IDLtAfs654k6Qv3EgdHquSOKz+cRvXX0BeoSxr9N3n6g+CWNx8QHl SkeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RGdAa4ln; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-141308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141308-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e2-20020a170902cf4200b001e43c7fbfe6si1661986plg.280.2024.04.11.11.34.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RGdAa4ln; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-141308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141308-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 91F4BB31DEF for ; Thu, 11 Apr 2024 17:47:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F934194C68; Thu, 11 Apr 2024 16:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="RGdAa4ln" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C53A2C184 for ; Thu, 11 Apr 2024 16:21:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712852507; cv=none; b=H/D3AxagLCjZQX7QLgcddMJ6gnBVrp0au2TWsXZvkrLuDjGU8akwP995w8USZNib0/mhRIc+M9mXN0jlED7cNNskhHeovBRSSelmXZwDJia/0n1N8tdkB8YYnbvoS01WZypOiAxUvymc808ww/mZ7XHrqgTQndMImnADhGfuvfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712852507; c=relaxed/simple; bh=j8D/Z53nu49+HJajrMHYyo77QiNAWVcuqSGJ2wCUdn0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mlM9myrmxfWR3DBR6Wunr2ZTQ/zt6CjXe1zkGV0P6YNzpdQmL9858eMJiDax59w8TyIQSvBhkdVbbAaFutXHepIAAPKBvI3rf4M95GbyskYYC7fvPg/ErvD3P1MGOmmSuwrzzHVxD+UGyBBoEXMxLYoxe3EFEhNTcNSmBkKRUVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=RGdAa4ln; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a522c00ce55so53829066b.0 for ; Thu, 11 Apr 2024 09:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1712852504; x=1713457304; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nb6qBOubwpr++hT5NYcUKi/PePjm+psMH2yQSPywASo=; b=RGdAa4lnvTgkAW7khWtzRtNQ5fF5aDOSejl6QAt7HDZ+OBSKNoyoEdibGaUQXMPbY5 FqvAPKiezRml+b/Xdl7FoF8stv//d4sZwFYv13ZkbJ0b04kPCMSRJcxKAqtYap64kQSK FmOBG8NRxmsElismgqtfL/500PAfYtHEpIk+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712852504; x=1713457304; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nb6qBOubwpr++hT5NYcUKi/PePjm+psMH2yQSPywASo=; b=wjWGl6Dkscoj+7ryxbmtUBtGCs0qUKKCknm3HG8F9znVhy4+63n9yJeWXoLCw+O8TN btBBAH5yIqM2iOT+o+OqrUGaC9epdEfmUlDP3ta3CVFu1DH/Cg1ToEOAcBgsn7aElYnU 9ySgx484rFZ/LPJObMBzp5GI/Dvzmo4g0bnA9JnyXqskSyaiHDZvi5BrcLNa1sMvkPO1 GdCEisk38cIcw/a0Owx8tgTRqBIyhI4YpyMkzYxFeNXvkN1KmY42k+vvrfBNzcu57ocS jGvDvtiTcKKA2UyhojWXXCkMNcTiFHsqcAJgnAKoMes1p0riZBpwtCfV9HL464b7NkoA Aq+Q== X-Forwarded-Encrypted: i=1; AJvYcCVH3MbEnD5pRfcL90/rAcPdSTxElXDe3YEscDa0MR5SkKfH/Oq4S+cdPMjZyG7qUKnSAjNeI6+k3lyRAGZWjeO2oklPbhj8n8HCjwhi X-Gm-Message-State: AOJu0Yyb7zECZnZmcRBkpCOyLVnJGhnoPQWQpPKKiaR32fN1Mh4m7bnd J9N0sUPEqk5Ws8Xxc84+bAzdJ39Cq/FZuoLTT6xc1ZyAac+F+IMOCu0xN9YsSaLluvblhO1hrz7 wAvKLgw== X-Received: by 2002:a17:906:f74b:b0:a52:1a82:7d3b with SMTP id jp11-20020a170906f74b00b00a521a827d3bmr182003ejb.0.1712852504385; Thu, 11 Apr 2024 09:21:44 -0700 (PDT) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id du2-20020a17090772c200b00a52299d8eecsm441849ejc.135.2024.04.11.09.21.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 09:21:43 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a522c00ce55so53826666b.0 for ; Thu, 11 Apr 2024 09:21:43 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXVMaADW48YPmOqlr4Y4yKxwbkWa70uKc8Ikv1IyfWH0BO9zyHVsijV4cQfwacPWAHWNS9OCHhyvaNWj3IFK51H0yZ+ewAbeuHrgSLC X-Received: by 2002:a17:907:7e8c:b0:a51:abb0:a8a2 with SMTP id qb12-20020a1709077e8c00b00a51abb0a8a2mr167343ejc.42.1712852503153; Thu, 11 Apr 2024 09:21:43 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240411001012.12513-1-torvalds@linux-foundation.org> <20240411-alben-kocht-219170e9dc99@brauner> <20240411-adressieren-preschen-9ed276614069@brauner> In-Reply-To: <20240411-adressieren-preschen-9ed276614069@brauner> From: Linus Torvalds Date: Thu, 11 Apr 2024 09:21:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] vfs: relax linkat() AT_EMPTY_PATH - aka flink() - requirements To: Christian Brauner Cc: Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lutomirski , Peter Anvin Content-Type: text/plain; charset="UTF-8" On Thu, 11 Apr 2024 at 05:25, Christian Brauner wrote: > > Btw, I think we should try to avoid putting this into path_init() and > confine this to linkat() itself imho. The way I tried to do it was by > presetting a root for filename_lookup(); means we also don't need a > LOOKUP_* flag for this as this is mostly a linkat thing. So I had the exact reverse reaction to your patch - I felt that using that 'root' thing was the hacky case. The lookup flag may be limited to linkat(), but it makes the code smaller and clearer, and avoids having multiple places where we check dfd. And that 'root' argument really is the special hacky case, and is not actually used by any normal system call path, and is meant for internal kernel use rather than any generic case. Linus