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 6D417C433DF for ; Wed, 12 Aug 2020 12:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BBBA2080C for ; Wed, 12 Aug 2020 12:43:51 +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 S1727912AbgHLMnu (ORCPT ); Wed, 12 Aug 2020 08:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbgHLMnp (ORCPT ); Wed, 12 Aug 2020 08:43:45 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 126B8C06174A for ; Wed, 12 Aug 2020 05:43:44 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id bo3so2070806ejb.11 for ; Wed, 12 Aug 2020 05:43:44 -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=Yvxiqidrbm3b4F4RmjtLyFgKduypL9rUzgeZlJDYTol527xUKz9gidGPZ3CrwWFrzm eyLX+ctBhCieAdZl/EIk5rHxSPDhbcaLnD60yHgbyEFVqAwcJYIJDumQ0H3furdOnnQ2 CEZbRqGwsUeuDoJy1wL2inEW8laXI6LK1qNh4+CnajxhEFetqkGgRzv8hOw7+HFiuu/w R8hB3wZL5+xTypgzPF3klnH1hPK05Rp/ji6wgG0mG3tWECGoX0E66YSJmFzZ29YRrCd1 CHM7rAdPzX23pCCkujdG2ApxuS/N2ZkX49bTRMdgcdkZSgygpts1pNt+37RoChqaphyq 96hQ== X-Gm-Message-State: AOAM5318uIwDF4njdXBh2tS1bQGHi6eQ1PSFcFdp+wAk9GuaG5CdVNCO JClUbKY1Lu4dSJwdP4qzCyRdJCHitzLpWvzgMReeTQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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