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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 B0A28C433E0 for ; Wed, 12 Aug 2020 12:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8771A2080C for ; Wed, 12 Aug 2020 12:43:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="hNR9GcSp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbgHLMnt (ORCPT ); Wed, 12 Aug 2020 08:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgHLMnq (ORCPT ); Wed, 12 Aug 2020 08:43:46 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4E93C061788 for ; Wed, 12 Aug 2020 05:43:45 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a26so2115461ejc.2 for ; Wed, 12 Aug 2020 05:43:45 -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=gCWyQNbioriHgzIQZKUiQvV8PcpAPmxSfvNLBzdg+So=; b=hNR9GcSpdiiY1n83D6FsfiqR1xB0RtCSJPEMDx9Yk2kx/4RPasQHoFu7V4WsF4oG+p 3YsZeqYeTZ3COk1dxTDvmZYS0Vnau0kXHGn2OVSJmw3M4NvkzfFlZ9JbhgwFxkSUIr5r lb7fy/OpQ96TgSP+Yc7ikbWNzhW5syY6rQows= 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=gCWyQNbioriHgzIQZKUiQvV8PcpAPmxSfvNLBzdg+So=; b=R/5iNPmFJ/nfdS2+D/s45YXtO1QOcNXURnjbW+hxS+JuDm82rb2GOcKunKhlo+ZrAf LPB1Iym28f7zy55Cmqw3CNF0SUO7TmT3FKBCbnbYTPImsBMSZfsxIzDOOMIwJepo18hP nKWhu9mKQPYIIuxiwD9o91I00RgcLN7F0A5nJYfSXjcpKrrWQb/E+76oI6flZXKX3fVt lfzHZZGcdxprLibX0kdY8AFZKLGIbfq33CvX0xH2ZZ9QAXJ0xEiIOZ4WAAVXyeDv1hur lV4n9Kpamf6epXZJ+6TIqF0BxYhE4BgMENxq0xXHX5ZEFbudavFuau9PAthw0aTOq08p PJiQ== X-Gm-Message-State: AOAM532bO7TBnYVv5NSYTqcgrFOhjnZ4m6Sx0OAxY4bigJHzLjQxZbD3 lx0T92Is8juFvhISmlXyPxtP83tQEs2NSbIY1gFvDg== X-Google-Smtp-Source: ABdhPJwZNA29O8JrX816txHUgy/+p+EaXvw60jZsZ8AsZIAKu00rfvbAcmmWGY9gxTN/9StYauqZYKkSwHrbPMzggEc= X-Received: by 2002:a17:906:4c46:: with SMTP id d6mr32652364ejw.14.1597236223300; Wed, 12 Aug 2020 05:43:43 -0700 (PDT) MIME-Version: 1.0 References: <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <52483.1597190733@warthog.procyon.org.uk> <98802.1597220949@warthog.procyon.org.uk> <20200812112825.b52tqeuro2lquxlw@ws.net.home> In-Reply-To: <20200812112825.b52tqeuro2lquxlw@ws.net.home> From: Miklos Szeredi Date: Wed, 12 Aug 2020 14:43:32 +0200 Message-ID: Subject: Re: file metadata via fs API To: Karel Zak 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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. If that assumption is not true, we could add a new interface for opening the root of the mount by ID. Fsinfo uses the dfd as a root for checking connectivity and the filename as the mount ID + a special flag indicating that it's not "dfd + path" we are dealing with but "rootfd + mntid". That sort of semantic multiplexing is quite ugly and I wouldn't suggest doing that with openat(2). 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); Yeah, yeah this is adding just another syscall interface, but notice how: a) it does one simple thing, no multiplexing at all b) is general purpose, and could be used for example in conjunction with open_by_handle_at(2), that also requires an fd pointing to a mount. Thanks, Miklos