Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp797812ybh; Wed, 11 Mar 2020 11:02:32 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkEh2uwSlksMr++sFPWc9cnszyoDSwi27do6uGvYUQHuw8G39CSpkJCWXOdiPKXDlOeIjB X-Received: by 2002:aca:5ed4:: with SMTP id s203mr2918283oib.102.1583949752528; Wed, 11 Mar 2020 11:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583949752; cv=none; d=google.com; s=arc-20160816; b=WaqzmAMNcn8ZpPkxpSgWQtR44iLxLK/YhjejiqqRucTVjbXKsszSf4fpwI6Daec/UJ Uk43uBwl+FOmBuuXeFRFzl4ey5VyssUfufpZfyulYaws20gC/tByeuzivZQiBkfsz1I8 0OYhidevkQPN/Zpq3T9bykAwZTi+EmsPgN5OVOlyDL8rFPujmxmdDXOkJ1Ic46HtN8Ct 6ZTlvzM06oFOSPZ2YGMPzF21xcSHfO6mi0ga9kgna0VCa82+aP949R6DaLYXfaWfHNKx lXc9/IeQqPw5EnbwGBtBPlnVaxHBHbl6afsKp6+1ROWb9l3wUSJ62TI2LEZPJa4eFG9k ORyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dpqDD1Wo+HKU40oDoKA/BJI8LsaHpPP8z3qrK9mKasM=; b=Fj7I2aIzKQc1l17WRUgJ16pKIv0elns/8JgjBDt+9RuERmcqzFOtg3TYepOI6VbBFa xNXBvkk6nDvs20KwMCGF/WvG2Fkpi/PPx+j1EtjA5z3aVQK6JTkmJ9+LzmEUpjHttEcT bfqe5zn423ObGio7wGw0WjQ0d//rv/DyeL9zvjpFVnRU0wRTjdfXWfh28aX2kysBNBcq dlVLrOXVFZuFImHGm0WsrdjFboexi7tMhleliT93mJ09w8EdfvZSEj1sy8Ai3f51Bdn9 HUvgYDoXrQSrpsyE3GQMVGvomMkE/0swelaoQ0bfjfpCW239o+XsZwT7eL2LJjEV1d/O fjtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ckkZBdQm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si1453873ota.17.2020.03.11.11.02.18; Wed, 11 Mar 2020 11:02:32 -0700 (PDT) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ckkZBdQm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730756AbgCKSAO (ORCPT + 99 others); Wed, 11 Mar 2020 14:00:14 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40760 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730692AbgCKSAM (ORCPT ); Wed, 11 Mar 2020 14:00:12 -0400 Received: by mail-lf1-f66.google.com with SMTP id j17so2495103lfe.7 for ; Wed, 11 Mar 2020 11:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dpqDD1Wo+HKU40oDoKA/BJI8LsaHpPP8z3qrK9mKasM=; b=ckkZBdQmXywHGIbczwxKoXJtM5bn1Q4zF8980dmDzUAerY42Vnt79h0/hrgko+maFY g6W5qtOcDU0FR7TReGj9YV2UAWuNcF/lAEUT03GfvSsuEW22s7MzLhczmTz71ew7VoeG 9tipLpaaHNIEBXH+b/EPSFlrBcI9QWo4iyKEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dpqDD1Wo+HKU40oDoKA/BJI8LsaHpPP8z3qrK9mKasM=; b=oY856EjMQM/eWrmwtdVgu4ofzrTYkMUNpleYTFLNXwsSbTA/y4jOjy3NCbuWx9YHCo XofoC/uTf0jQ3F5lrvODHK11E2JZ70IE9uGUrMboq/g4zsq035a2A7+is8uSAUqfoJS5 VR4pIXTQuhj7OQ7bYizxuvN1mDF3yETYK0GUqF78uxXcmRWpj0rdiOUlrNb20AjZxcvJ YzSbpw3pI51YXbomFKiQraHwo0VHjJcMwzQNlABN5Y8FqSZ+2oGfE/MTneIWpuv3+d+A McrJfu+0zdC7dNKRm5A9e9WC9HzfiEW+dvI2qnRRcfFjiya4P42CwhfSucd7vPX5OgMl Z6hg== X-Gm-Message-State: ANhLgQ3GQzKwCVBcPxpC20ljXzE8+JeOkWZFZKyNoq/4zKvuS5STadxK qmHbTzxF8vp0uYhP6AcnXA/4KmWMYY4= X-Received: by 2002:a05:6512:1085:: with SMTP id j5mr2885555lfg.183.1583949609792; Wed, 11 Mar 2020 11:00:09 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id r2sm1911459lfn.92.2020.03.11.11.00.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Mar 2020 11:00:07 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id r24so3388517ljd.4 for ; Wed, 11 Mar 2020 11:00:07 -0700 (PDT) X-Received: by 2002:a2e:5850:: with SMTP id x16mr2622296ljd.209.1583949607115; Wed, 11 Mar 2020 11:00:07 -0700 (PDT) MIME-Version: 1.0 References: <158376244589.344135.12925590041630631412.stgit@warthog.procyon.org.uk> <158376245699.344135.7522994074747336376.stgit@warthog.procyon.org.uk> <20200310005549.adrn3yf4mbljc5f6@yavin> <580352.1583825105@warthog.procyon.org.uk> In-Reply-To: <580352.1583825105@warthog.procyon.org.uk> From: Linus Torvalds Date: Wed, 11 Mar 2020 10:59:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/14] VFS: Add additional RESOLVE_* flags [ver #18] To: David Howells Cc: Aleksa Sarai , Al Viro , Stefan Metzmacher , Ian Kent , Miklos Szeredi , Christian Brauner , Jann Horn , "Darrick J. Wong" , Karel Zak , jlayton@redhat.com, Linux API , linux-fsdevel , LSM List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 12:25 AM David Howells wrote: ? > Okay. So what's the equivalent of AT_SYMLINK_NOFOLLOW in RESOLVE_* flag > terms? Nothing. openat2() takes two sets of flags. We'll never get rid of AT_SYMLINK_NOFOLLOW / O_NOFOLLOW, and we've added RESOLVE_NO_SYMLINKS to the new set of flags. It's just a separate namespace. We will _not_ be adding a RESOLVE_XYZ flag for O_NOFOLLOW or AT_SYMLINK_NOFOLLOW. At least not visible to user space - because as people already figured out, that just causes problems with consistency issues. And yes, the fact that we then have three different user-visible namespaces (O_xyz flags for open(), AT_xyz flags for linkat(), and now RESOLVE_xyz flags for openat2()) is sad and messy. But it's an inherent messiness from just how the world works. We can't get rid of it. If we need linkat2() and friends, so be it. Do we? Could we have a _fourth_ set of flags that are simply for internal use that is a superset of them all? Sure. But no, it's almost certainly not worth it. Four is not better than three. Now, some type-safety in the kernel to make sure that we can't mix AT_xyz with O_xyz or RESOLVE_xyz - that might be worth it. Although judging by past experience, not enough people run sparse for it to really be worth it. Linus PS. Yeah, we also have that LOOKUP_xyz namespace, and the access mode namespace, so we already have those internal format versions too.