Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp424360pxa; Wed, 12 Aug 2020 05:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7mZkiMhQn/LANpEMN0/Dk6cV9KrMN2ys5z4msiTI/2x2C10B56dU43Iu2W2EkzrssTkNJ X-Received: by 2002:a17:906:c143:: with SMTP id dp3mr30431041ejc.504.1597236312549; Wed, 12 Aug 2020 05:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597236312; cv=none; d=google.com; s=arc-20160816; b=gtZfO4nGA9patxChHN6l0fqd2X75+cYT5pdSm0VCz9OPM5VvtxO9AaqBOC5ZQ4wi6g TVEgEyFn1AxhF6QW7LHkW7apjVV9iTJq8iEYHYHrdhWlJHWw/T+yxuMADnA77O/kJwdX nn1augSZ42FEVl3gHROiqfehuNqJjGNdlE4W5sAP+nT3u7MgpyblrCAJyuAAmmUYe/hk cscbZLBAztHuLinwW//X9HGeOh17M55ztj/KxrMkb5cW9Zi1CltKbDVSybEgrP4zX6F9 1etYwof0L5VjQT13T6A6RFu222aA2Yo2TM8oRC3H2fRfKLQUBnw6xZSfZGNBgf/mRebc +PeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gCWyQNbioriHgzIQZKUiQvV8PcpAPmxSfvNLBzdg+So=; b=wLmoQPYal5q9Ie5phOQTHn8ehWqsPIsxbx3jc2XIRJzHgYz4IMkc8ju5OUZ37v8wsm nodWtsZhbtF4b33jQq97JzPfeAsxMIq9l/gu1VRZkb1xvP96aQKBi+KAebaxU/7oVW09 JwMNSaAugA6/cz7GFuoMS0asPrr7AGj9MAfTROaHnn7sj5bdrawoqGdIVG/t+zBwqBc1 nwqocZtVCKhuwUPYLlkR8HRWFqApsq43VKsR/9Nd7NpGdjIj11gJGpbvvc2TXrvPVmxX 7rK32Y4CzPS/EsBrcZLe2CcQAgMlSSv3mooQF1OW8qhSgGygipCDDExENR8T8Es6rBgH zgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=hNR9GcSp; 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 u24si1324125edb.159.2020.08.12.05.44.48; Wed, 12 Aug 2020 05:45:12 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=hNR9GcSp; 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 S1727885AbgHLMns (ORCPT + 99 others); Wed, 12 Aug 2020 08:43:48 -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-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