Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2955134pxa; Tue, 18 Aug 2020 02:32:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb3UMbQ1pINJPtb1HvIw0iaFK1M7fsfEV9AvQghr/+cNX2WYF+aAVMoUXD9qOnOfV1/jj0 X-Received: by 2002:a17:906:1604:: with SMTP id m4mr18700616ejd.6.1597743147746; Tue, 18 Aug 2020 02:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597743147; cv=none; d=google.com; s=arc-20160816; b=B2TOvmBRtiwLZwLqUI4L8ef4nmJCJSJCwYAGl2sdRZilqeOYaJfo64NG/YNSctG8AF iv+f64q/LahbxPcPS6gDZ2wZ58MHPRRbB38An1gY7w/5ILrYkDDHfwfmi4932AEYntt8 aKllM3VmmVrkPFkNZsCait/jtfHK8I6PTJMutusGfaccUIv1JncB23FVChnmJ5KgnMUn Fo6EfxxcrqLcPHBbQ7nH0hfq7NIYtI5hInTdfUAnD9xRexTyGOLsUwaUSi18KeEyCmud b9VlxLU+dqQTVJKGoUVhQrHkMjX4NcvKdOXayZEkeo/d3yNdE+x2Ybw29eoshu12ICvq TuAQ== 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=G6i6GBK3wCZWsxoTDmOd3ySKBv/GJjmU+V1QuwmXmlk=; b=RAjD2vDQNlrjLLDs3Ju8zp8yN52EqO69oDnr8KkGXkaXk/M0P/eaRRrJ9E4+OiAHsk HtmAezw3cMvgMjQJI1PffmV2eD0ZlHoshglY+bEoB0VWrclFbX9Qhp9or97Xmd1Viw52 V/21YK62d75p9qupLRubnQEyalB8e5TcZD5ymsJ01Bxpco+p7nUE+0z28ThJglGA7XFi qS95hG8lDdzsgngvjNjlwcEyqmOLOe3SgkMBB94j7d1AaTZYA/Yikh4KdVFsEajzoRuB vrIFXd9ho+4eD2TMtcEwXbRK2gcRgyelLMRp7n6O7wNj1r9PJbxcS034Y01Z88DDkDhP kRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=ovlkGX8q; 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 e23si15682530ejl.306.2020.08.18.02.32.04; Tue, 18 Aug 2020 02:32:27 -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=ovlkGX8q; 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 S1726420AbgHRJas (ORCPT + 99 others); Tue, 18 Aug 2020 05:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbgHRJao (ORCPT ); Tue, 18 Aug 2020 05:30:44 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BC6C061342 for ; Tue, 18 Aug 2020 02:30:43 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id d6so21259000ejr.5 for ; Tue, 18 Aug 2020 02:30:43 -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=G6i6GBK3wCZWsxoTDmOd3ySKBv/GJjmU+V1QuwmXmlk=; b=ovlkGX8qod/bhtZAl4qKbrC5By2+6D1ouRJLhibBITDMjhaNSGfIZF8qD5afYOF5Nw cV3HmxMj4H3TwTUZZL+0v5NHdrDqt/ZYDq/gwxcfRy2TrsVF+JbuOfSgvwm+uVCQwinw +XSe4C1sN6eZB5AEceOR647X9E3OJg51aCnWA= 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=G6i6GBK3wCZWsxoTDmOd3ySKBv/GJjmU+V1QuwmXmlk=; b=F3ygRcNj3Ir2feGfup1LNwUdMXnPkt/1gPx2gfZdfikV/u88IIfFnoXKCCu7DncivV iusQqIpCZ23hAULSjToLYGUpafDxWX1UvY1rDV2BQCS1wS0ACAtuFKRTkHBmw1MfJm3f s44r/VpGRd4zAPDpPNv8JMfPEUcJsJhnYoPnbfxG3w9Ezr39ATXj67VJciRseJ2oxib9 85igd5jrwqWR7+fgX1RJfK38A6hjmdstBz2d+Qh9n6VDYqkTLnhgmlR8hK7a+ExTxUfl F0JNVk2zxpErlw7b9xFJQYWO5GK+CNqL2WnfDfJ4miBL9N0iA6T5uBnCdG90N1cR83AJ ZYMw== X-Gm-Message-State: AOAM533NtA0l0bm9GnhGzovcB9M7Ol8oFwzr2/OCeEjZGEYykZReHjUL ew3C0lInH39Cr6zPFpnNyXDPkW4EjQE01TfE9QuKLQ== X-Received: by 2002:a17:906:4e4f:: with SMTP id g15mr18796618ejw.443.1597743042044; Tue, 18 Aug 2020 02:30:42 -0700 (PDT) MIME-Version: 1.0 References: <20200812143957.GQ1236603@ZenIV.linux.org.uk> <20200812150807.GR1236603@ZenIV.linux.org.uk> <20200812163347.GS1236603@ZenIV.linux.org.uk> <20200812173911.GT1236603@ZenIV.linux.org.uk> <20200812183326.GU1236603@ZenIV.linux.org.uk> In-Reply-To: <20200812183326.GU1236603@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Tue, 18 Aug 2020 11:30:30 +0200 Message-ID: Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: Al Viro Cc: Linus Torvalds , Jann Horn , Casey Schaufler , Andy Lutomirski , linux-fsdevel , David Howells , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , 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 Wed, Aug 12, 2020 at 8:33 PM Al Viro wrote: > > On Wed, Aug 12, 2020 at 06:39:11PM +0100, Al Viro wrote: > > On Wed, Aug 12, 2020 at 07:16:37PM +0200, Miklos Szeredi wrote: > > > On Wed, Aug 12, 2020 at 6:33 PM Al Viro wrote: > > > > > > > > On Wed, Aug 12, 2020 at 05:13:14PM +0200, Miklos Szeredi wrote: > > > > > > > > Why does it have to have a struct mount? It does not have to use > > > > > dentry/mount based path lookup. > > > > > > > > What the fuck? So we suddenly get an additional class of objects > > > > serving as kinda-sorta analogues of dentries *AND* now struct file > > > > might refer to that instead of a dentry/mount pair - all on the VFS > > > > level? And so do all the syscalls you want to allow for such "pathnames"? > > > > > > The only syscall I'd want to allow is open, everything else would be > > > on the open files themselves. > > > > > > file->f_path can refer to an anon mount/inode, the real object is > > > referred to by file->private_data. > > > > > > The change to namei.c would be on the order of ~10 lines. No other > > > parts of the VFS would be affected. > > > > If some of the things you open are directories (and you *have* said that > > directories will be among those just upthread, and used references to > > readdir() as argument in favour of your approach elsewhere in the thread), > > you will have to do something about fchdir(). And that's the least of > > the issues. > > BTW, what would such opened files look like from /proc/*/fd/* POV? And > what would happen if you walk _through_ that symlink, with e.g. ".." > following it? Or with names of those attributes, for that matter... > What about a normal open() of such a sucker? It won't know where to > look for your ->private_data... > > FWIW, you keep refering to regularity of this stuff from the syscall > POV, but it looks like you have no real idea of what subset of the > things available for normal descriptors will be available for those. I have said that IMO using a non-seekable anon-file would be okay for those. All the answers fall out of that: nothing works on those fd's except read/write/getdents. No fchdir(), no /proc/*/fd deref, etc... Starting with a very limited functionality and expanding on that if necessary is I think a good way to not get bogged down with the details. Thanks, Miklos