Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp713320pxa; Wed, 12 Aug 2020 11:34:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze7yC7jJQaWc6CttgC0DWuxa7vSOw1c7uiiQGOKlYL+24nW5vkmGE2VG6zvGzaZ+qgoLo5 X-Received: by 2002:a17:906:82ca:: with SMTP id a10mr1131160ejy.524.1597257275806; Wed, 12 Aug 2020 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597257275; cv=none; d=google.com; s=arc-20160816; b=tgH+JJIYfqjJSrdv+Yft7wkyf+YIeof60ljXjG6kzoxBo4L+HlSPm+UPFw+PNRsIF1 STLMuqBBPsVXlCnEO+qTTMOK8CaF7luLBFT4utVphv5lVBEiY3vz5ll15YlO40DR1hPT OknT86izW6MSkjK8VNycriHrKrLhWAZ2B/nBvqHXin3WCD/FnmW46rrRA07xYuwuFndb 2sZxw/Sdz6WXMUmRqQT8z/sT5UchM3FZnTubFkAHbRVFLoVTYgnHH8HkWrPl6XEmpG0Z JrfBYu9qHZKpoKkoeW/8RFVFmmjlf4sqtt4qJcWo5WHgT6rbq6zuZD45TmNiVynyayrz kJvw== 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=0Ao8A/sprVx5ZquuDVG3UNQB6jHuzLU1SHgEBQA6wno=; b=bnIDXeoknd8po/QZqIEKgY6cVvJ2C24kMAIFNLyqxmTEiv7QjEiGB0XC/H5KkHmpmf mfiCn36C/txewgLIMHkyYZy+4MzeLNO4F7smavMs9L1jZyUNrJUagJqeDOZpjfvsyUe9 LmA1WWq5d2jokY86rhbenxRl9P0+rW6ftlKEtzrIBJPM2I4ThVhBByQDZDIFlQjzS1tT VDuNHwu+kw29IFtq6c9E2vSYVckBrMQel9YZsU4BWM8L49WaP5H4q95Uivko0GL4KlWR 11i9sGY1IbdibJne2Z36MlUguj70cIHRpWAgavdsTY1GW0DJJnpglZvfthRLS+sPuPZl ivVw== 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 za3si1698146ejb.312.2020.08.12.11.34.13; Wed, 12 Aug 2020 11:34:35 -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 S1726631AbgHLSdl (ORCPT + 99 others); Wed, 12 Aug 2020 14:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgHLSdk (ORCPT ); Wed, 12 Aug 2020 14:33:40 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37BF8C061383; Wed, 12 Aug 2020 11:33:40 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5vZ0-00EEH8-Kk; Wed, 12 Aug 2020 18:33:26 +0000 Date: Wed, 12 Aug 2020 19:33:26 +0100 From: Al Viro To: Miklos Szeredi 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 Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) Message-ID: <20200812183326.GU1236603@ZenIV.linux.org.uk> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200812173911.GT1236603@ZenIV.linux.org.uk> 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 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.