Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp470453pxa; Tue, 11 Aug 2020 07:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1oqREIj0mEK2JngIGkGLi0fRnv5De4U4vHBwXmKCbT+QsZASjzDNQf0JVv3ZaRVmtaHG6 X-Received: by 2002:a17:906:3493:: with SMTP id g19mr27953261ejb.253.1597156346074; Tue, 11 Aug 2020 07:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597156346; cv=none; d=google.com; s=arc-20160816; b=UtbsIsrJSbSLspEGKspJcFQcmUqcLDEvvvGw8IOe6vphmdiyQ1WxsCBUllR34FfGut pDN0EpMoXCYvbAG4YKjJ9cstt8zapG54GbtsprVFiQVMSHZw3G0OHeMbcp55/lKCcifn SOC+1vjhdonLnQ2ln8hMGgEesQzYZAa/8boMuZc0rvCaUTS5LPcbzmHFjZz+M2WXnGrT pBGaOL/o5RQDZVbLsNJFrGtrMIveTBqtAygmPxGoTFsX48lTDRBfLoOjNPpQ2bK1uP4y 3idyvsjhoVLaapFYrXT13rIhZVkDt1w4pgQyLZRSMdlbTUkzetVGXrqlqZ3KtJyXjWU2 z83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nqVW6/+9HWIBeExL3fR9M8Pea5WypkR8zhK5lhESuC4=; b=QvPMggBiAW/tKWjGybZurPGg0f5OK25+ngvnbBXBPvrSgkSh+PVURQU9GrKvMNObHC 4g694rMF0NLatFnLFyClH57L4cZseHr4vQuxoivK7yEyePG/sOk9YkKma1YNnM4c8zfm pan8yW5zCCtO4QTmvJImt2ihafvmle5GiH7JuOR4VRelU16JFZcSwR5axcTFwAhsRvsN 4whA5TAsAq5XAv9AHJv56DHt0YCACHd1OxZ47BUcD09077uLh576wLviSZCYAbuzdojI y3GgNs+32eTT+l+vWk+tkVdig1z3cRzYCxlA+Hb89pzMuWycPWGcIFEyY98BcTjUjx8u es3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 e12si13978998ejd.148.2020.08.11.07.32.03; Tue, 11 Aug 2020 07:32:26 -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; 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 S1728835AbgHKObP (ORCPT + 99 others); Tue, 11 Aug 2020 10:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728516AbgHKObP (ORCPT ); Tue, 11 Aug 2020 10:31:15 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92EF3C06174A; Tue, 11 Aug 2020 07:31:14 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5VIx-00DcVF-Gw; Tue, 11 Aug 2020 14:31:07 +0000 Date: Tue, 11 Aug 2020 15:31:07 +0100 From: Al Viro To: Miklos Szeredi 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 Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) Message-ID: <20200811143107.GI1236603@ZenIV.linux.org.uk> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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...