From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7106C433E3 for ; Thu, 13 Aug 2020 08:53:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C26102078B for ; Thu, 13 Aug 2020 08:53:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZbUslsAH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726244AbgHMIxI (ORCPT ); Thu, 13 Aug 2020 04:53:08 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:54104 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726081AbgHMIxH (ORCPT ); Thu, 13 Aug 2020 04:53:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597308786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bHxBlhSxxa/67DKNkFk3S3CDohJlBQmN8kkHMo7F2jw=; b=ZbUslsAHu3sgveWvWXm2hALTSdsK9dX/3JkGXB4b+UCMKx822LO3HPQV9I4yGSxgUF9euO bo5LAD/dXjbcOct/IgncvqNQanaouLkcjbWY1RvKP/LVCCQecivyu46ZbAUQU4wRzHYklM ee7FHFmRuas+pu7o89+BI6yeugZGu+Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-g7xpvjS9Pg-ZPkk-XNFWnQ-1; Thu, 13 Aug 2020 04:53:01 -0400 X-MC-Unique: g7xpvjS9Pg-ZPkk-XNFWnQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D1BF80046F; Thu, 13 Aug 2020 08:52:59 +0000 (UTC) Received: from ws.net.home (unknown [10.40.193.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FE145D9F3; Thu, 13 Aug 2020 08:52:55 +0000 (UTC) Date: Thu, 13 Aug 2020 10:52:52 +0200 From: Karel Zak To: Miklos Szeredi Cc: Steven Whitehouse , David Howells , Linus Torvalds , linux-fsdevel , Al Viro , 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 Message-ID: <20200813085252.ezwd46ahyjiz4flh@ws.net.home> References: <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <52483.1597190733@warthog.procyon.org.uk> <98802.1597220949@warthog.procyon.org.uk> <20200812112825.b52tqeuro2lquxlw@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 02:43:32PM +0200, Miklos Szeredi wrote: > On Wed, Aug 12, 2020 at 1:28 PM Karel Zak wrote: > > > The proposal is based on paths and open(), how do you plan to deal > > with mount IDs? David's fsinfo() allows to ask for mount info by mount > > ID and it works well with mount notification where you get the ID. The > > collaboration with notification interface is critical for our use-cases. > > One would use the notification to keep an up to date set of attributes > for each watched mount, right? > > That presumably means the mount ID <-> mount path mapping already > exists, which means it's just possible to use the open(mount_path, > O_PATH) to obtain the base fd. The notification also reports new mount nodes, so we have no mount ID <-> mount path mapping in userspace yet. The another problem is that open(path) cannot be used if you have multiple filesystems on the same mount point -- in this case (at least in theory) you can get ID for by-path inaccessible filesystem. > A new syscall that returns an fd pointing to the root of the mount > might be the best solution: > > int open_mount(int root_fd, u64 mntid, int flags); Yes, something like this is necessary. You do not want to depend on paths if you want to read information about mountpoints. Karel -- Karel Zak http://karelzak.blogspot.com