Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp474851pxa; Tue, 11 Aug 2020 07:37:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWF7kvHlv8k2zZJLsWlq4IM2/CGJtUvNO/BOcAB978BXxR608VFOqJXC7ywdl9w96mnfMU X-Received: by 2002:a05:6402:206d:: with SMTP id bd13mr26751345edb.57.1597156675176; Tue, 11 Aug 2020 07:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597156675; cv=none; d=google.com; s=arc-20160816; b=wUn28pki21j3gk1puPdKQiKY8uyUs5IHawqW7EZ4rHB0gT+ndmJJY6/zC9xkDdq+tc Ua+/HJ0g8YauNt5vlZhrNsIbMfKjWVkt5h4sH033cVFon2EwpvadM+tnNgtr6T4x9nfo K4F7yPS5ROjCqmbV5jJVKxyXstBe4J7CIAUG5qSMe1kNMRrFEfGdAKOR2gVS/eCikYSv Nc9kV1ITOsB79xR6s46VmfUpuJG89eUDhk+bypnSNb2MO4XABTEeNCzo6YhqBv4UgCLw nD48wqhgq6ZiwYolYcGfUiszzFEVv9r9tBXPwLYMxmQYjaBeFyNdhAQ6F7wxq7Tnp8Up vNbA== 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=aqdx28YA3pNP6REzIkc0gA+th2RV2sA+pXLZKVTobEc=; b=bv43UZ0pON2NGE0ZxP/6ljWpLSsaiAp1Tc4Rgoyi4q+HsAVpWKqdjMZsrLir1RlcCH 4kF/3JpBZ03IfPGRi1ZLtC3iDFwYcbge44CzWTtJkCrxPt/1EOAqfSLyKCKPOqV7tTJ4 rv75sQ0XG+NmaJ+UU7Ughx53NdwLdYyyQKlU8A5peohZu/REXjOevYTdZgVXirzz8miQ 2AmKJuLIHykwK4lSywWf94BE9ypwQFKtd8ZlbXuARzEyGyGvKzQG+CPA0XQxDXX7KNnE QTCHmYAA0MhqRO8o6DCRt6O0D20PnCXFxT0zYjdWg1mgGD7Y2NsXs0mb+rQHLP3ItR9R iQ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Q1ksszNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si8984497edl.234.2020.08.11.07.37.31; Tue, 11 Aug 2020 07:37:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Q1ksszNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbgHKOgr (ORCPT + 99 others); Tue, 11 Aug 2020 10:36:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728760AbgHKOgq (ORCPT ); Tue, 11 Aug 2020 10:36:46 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08834C061787 for ; Tue, 11 Aug 2020 07:36:45 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id c10so9248047edk.6 for ; Tue, 11 Aug 2020 07:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aqdx28YA3pNP6REzIkc0gA+th2RV2sA+pXLZKVTobEc=; b=Q1ksszNnkE3uXErudLxD5Slds/9xC2LepwVHl/yg53pTvHQKvRVeVoUg19cu3r8O/d 2j5OwMLDoAG2lTQ7vwNNjuRby0rp1tOy3R428/P7KvCr+CqmNv4b9Nxng7AZH6DqOvtU tf6V8M7ABdiI9pdl+NAAhtTZ4ax+VPsqyGlKc= 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=aqdx28YA3pNP6REzIkc0gA+th2RV2sA+pXLZKVTobEc=; b=qEADhPDgQRjmRHMQAnAPwFEox6J2+pzFlP6q0Wtp0WVprcFU0xzVercBFd1eAfLFri u/t9+boE+eQUhPaSN4gmSDzPIv1aQgzMN7Z1Gb+OkHr1FNnlX/u//t18cMhWdZzD/mzH bUFPqdpryaGhSOk7ayZvT0CjNU45MYHTvGV9k7bceSkdM1s09WQiAmj6zjVbGAL90Udx 3Ubv3oLEOI2kqXhD8HlJp23VtxoUlsnFrrq15CVsJGQb5zSNmsymJqpWV8A1f5837/1g 4b5ieF+1s3HkVM2FqMn647xyiz0f+AFhLRDSqFM7FT1LrH3t9D4kV0i2STeZWHRwSDyM 2ysw== X-Gm-Message-State: AOAM53325pu8nh8XsR9PlGXID4HD1BI7aRPVEGDIYdc1UFfBIV4c2Y03 5x/4REZIm8ZrBqgMhwFS/MULj3zc97U7Ejx4gpCwiw== X-Received: by 2002:aa7:d688:: with SMTP id d8mr26760651edr.168.1597156603660; Tue, 11 Aug 2020 07:36:43 -0700 (PDT) MIME-Version: 1.0 References: <1842689.1596468469@warthog.procyon.org.uk> <1845353.1596469795@warthog.procyon.org.uk> <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <20200811140833.GH1236603@ZenIV.linux.org.uk> <20200811143107.GI1236603@ZenIV.linux.org.uk> In-Reply-To: <20200811143107.GI1236603@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Tue, 11 Aug 2020 16:36:32 +0200 Message-ID: Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: Al Viro Cc: linux-fsdevel@vger.kernel.org, David Howells , Linus Torvalds , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , linux-kernel@vger.kernel.org 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, Aug 11, 2020 at 4:31 PM Al Viro wrote: > > On Tue, Aug 11, 2020 at 04:22:19PM +0200, Miklos Szeredi wrote: > > On Tue, Aug 11, 2020 at 4:08 PM Al Viro wrote: > > > > > > On Tue, Aug 11, 2020 at 03:54:19PM +0200, Miklos Szeredi wrote: > > > > On Wed, Aug 05, 2020 at 10:24:23AM +0200, Miklos Szeredi wrote: > > > > > On Tue, Aug 4, 2020 at 4:36 PM Miklos Szeredi wrote: > > > > > > > > > > > I think we already lost that with the xattr API, that should have been > > > > > > done in a way that fits this philosophy. But given that we have "/" > > > > > > as the only special purpose char in filenames, and even repetitions > > > > > > are allowed, it's hard to think of a good way to do that. Pity. > > > > > > > > > > One way this could be solved is to allow opting into an alternative > > > > > path resolution mode. > > > > > > > > > > E.g. > > > > > openat(AT_FDCWD, "foo/bar//mnt/info", O_RDONLY | O_ALT); > > > > > > > > Proof of concept patch and test program below. > > > > > > > > Opted for triple slash in the hope that just maybe we could add a global > > > > /proc/sys/fs/resolve_alt knob to optionally turn on alternative (non-POSIX) path > > > > resolution without breaking too many things. Will try that later... > > > > > > > > Comments? > > > > > > Hell, NO. This is unspeakably tasteless. And full of lovely corner cases wrt > > > symlink bodies, etc. > > > > It's disabled inside symlink body resolution. > > > > Rules are simple: > > > > - strip off trailing part after first instance of /// > > - perform path lookup as normal > > - resolve meta path after /// on result of normal lookup > > ... and interpolation of relative symlink body into the pathname does change > behaviour now, *including* the cases when said symlink body does not contain > that triple-X^Hslash garbage. Wonderful... Can you please explain? Thanks, Miklos