Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1156323pxa; Thu, 13 Aug 2020 01:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlTc/iXY6kND9vyrXEJoyzCBAJ1O2rXz9Ej3gE5oCM9/IsZIOMZe1D0JJ3c/6UfOlri3rb X-Received: by 2002:a17:906:e118:: with SMTP id gj24mr3619150ejb.219.1597308857344; Thu, 13 Aug 2020 01:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597308857; cv=none; d=google.com; s=arc-20160816; b=b6DEY9uNCsZr2uosXNwiecP9OwomJXRYuZzKgkSypm7DyqzWPAfT5BSdpmTLY9Z4yX 3BdDI2xeZA77OvXyxJ+YnSuLqqsXZNfACk8Gatei6xxFwfiLVtYp13c/YQlHt8NcX/a5 FsCZGRhhg9ojE+P1hJVTaF0FkyBYOnpnapp+a4VgtrTZXFIiqv6CHBp7XLCwl7IINceK 7914NyO2pxOSTV5jnZ9Cn58HW++dmAkw4HZT3mt3XgJd2/2Y/DSaI5rbSEHkglJC5nB8 P093mVdrKg7cR0weEECl9rg+0HObjuvbOWICYni+HuXbVyhtjf1R30f0QIIjyABWbm6P ecQw== 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 :dkim-signature; bh=bHxBlhSxxa/67DKNkFk3S3CDohJlBQmN8kkHMo7F2jw=; b=SCTgsmFMKqoPQ7M9e+Xhj0F6OQUUmqMBBzJI6gzQyooN4ialmfV3LgfMqRu2vP2sz2 iTn2h1DKzQyFRazDv14v3ZUKndnXxujKOcgBhrufrjAqR0G9eY7wETR7frkzx1DBO5jx 7FDSKxobgsZQDEeJ1o1ZHiapcKMC3stDtKyv39NqBUtzVI8RlUPY/VEaBpXakQD6gjFt SRH3kvhb7pOmkRYX/s45pOyCJKU5M/9eZPd9mhRnYwZ4pP1fxHhyTDQxlSGpi3iO8ZUy Pr5qQdC0UqA8UuqdQEKHhaDV1QtKLCDdoWdrvOJRxKPAUaGog+gLw+og73fF5g8I7z1j 1ZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZbUslsAH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si2981309ejg.497.2020.08.13.01.53.54; Thu, 13 Aug 2020 01:54:17 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZbUslsAH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726048AbgHMIxI (ORCPT + 99 others); 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