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=-1.0 required=3.0 tests=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 BBC22C2BA1B for ; Mon, 6 Apr 2020 16:40:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 917EB24965 for ; Mon, 6 Apr 2020 16:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586191242; bh=jd+QYmsLAndEMcvErDpP1RE/VLLxn/LwwnxoCW7nOVg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=I4Bt64bBbLVYRipQVyKQRCKwsg4Pg9iJN/yj5ZcoG/kt5mMXMr7NQ0tKz7AOfbFst FQ/cBsMiUs+OHWdHZbPkP9MZ5bccdifcW5WeeaykWkSRRhuXitwK6XEipKtrL8Mclf VYFKZwCB8BrU20C+28dx37h28/kYD3imWak4E07U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729566AbgDFQkm (ORCPT ); Mon, 6 Apr 2020 12:40:42 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46908 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729485AbgDFQkl (ORCPT ); Mon, 6 Apr 2020 12:40:41 -0400 Received: by mail-ed1-f67.google.com with SMTP id cf14so232931edb.13 for ; Mon, 06 Apr 2020 09:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fMHiT/Wub3WobBASn8jTrpUwrDr3u4OoR64hK8bb9Ks=; b=AfWDLI+z1soflaJhqnVIBl+g08ryFIMdzJqIJa45tvPYBFyKn+PmZgyAKpbs5cJwZl 9gtU1jadiJkYAbncJSZUPSb1X2kcckqoo15hGsCWmJf/qxcwWTHrb5wLDAA7sDdZ3t6B sFkeB7u4W8ywdCcWyLji2espSviyDN/+Gi3rc= 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=fMHiT/Wub3WobBASn8jTrpUwrDr3u4OoR64hK8bb9Ks=; b=ob6y4jWjAcgdePFAjknRGflwcyELhDm4VK3wZE21luRo2aylcR7PKVszmLqPGXpS59 Fdtwmbbmdl2ZsDdcFW3BX9c1ZMhuxRqE30jPyzxwqOvQiZdRpCAUl4KNLhmv2PqA+Lci xuCbjprLCOOvtZGbYESk7cPswzpf7bRljHrJMwwTducL75AOAn95TbX3QiV5x0/Znm7S mrEODCawyaMNO87s2btzEazxxVxayuW54KLtbeUHSGMeEtkgblHLaCl03pZL9x3yq7OO AJIWpEyK7M8Q69BxUKWP7QNXJg7wqdYBrVTm56MbpUFrFT3Ug/Tbt4JOfCVjfog7JBnJ eqCw== X-Gm-Message-State: AGi0PuZ9uW32SM5A4rdmxB4VYmlK9v+mxBsQKBacZYD+RAO8pBaotos1 lr6gNu/5V762sJD8hsVpkHzvRyCn+VA= X-Google-Smtp-Source: APiQypJIYspZ0Zlwad9Po3sAfaOki44In+/2kYTMgEv/zf735SrClv9pb71VQNTfbHSAbs5UhmVeXA== X-Received: by 2002:a17:907:b1a:: with SMTP id h26mr324922ejl.321.1586191239653; Mon, 06 Apr 2020 09:40:39 -0700 (PDT) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com. [209.85.208.42]) by smtp.gmail.com with ESMTPSA id u13sm2478736edi.82.2020.04.06.09.40.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 09:40:39 -0700 (PDT) Received: by mail-ed1-f42.google.com with SMTP id z65so340285ede.0 for ; Mon, 06 Apr 2020 09:40:39 -0700 (PDT) X-Received: by 2002:a19:7706:: with SMTP id s6mr10019987lfc.31.1586190864915; Mon, 06 Apr 2020 09:34:24 -0700 (PDT) MIME-Version: 1.0 References: <2590640.1585757211@warthog.procyon.org.uk> <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> <27994c53034c8f769ea063a54169317c3ee62c04.camel@themaw.net> <20200403111144.GB34663@gardel-login> <20200403151223.GB34800@gardel-login> <20200403203024.GB27105@fieldses.org> <20200406091701.q7ctdek2grzryiu3@ws.net.home> In-Reply-To: <20200406091701.q7ctdek2grzryiu3@ws.net.home> From: Linus Torvalds Date: Mon, 6 Apr 2020 09:34:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() To: Karel Zak Cc: "J. Bruce Fields" , Lennart Poettering , Miklos Szeredi , Ian Kent , David Howells , Christian Brauner , Al Viro , dray@redhat.com, Miklos Szeredi , Steven Whitehouse , Jeff Layton , andres@anarazel.de, keyrings@vger.kernel.org, linux-fsdevel , Linux Kernel Mailing List , Aleksa Sarai 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 Mon, Apr 6, 2020 at 2:17 AM Karel Zak wrote: > > On Fri, Apr 03, 2020 at 04:30:24PM -0400, J. Bruce Fields wrote: > > > > nfs-utils/support/misc/mountpoint.c:check_is_mountpoint() stats the file > > and ".." and returns true if they have different st_dev or the same > > st_ino. Comparing mount ids sounds better. > > BTW, this traditional st_dev+st_ino way is not reliable for bind mounts. > For mountpoint(1) we search the directory in /proc/self/mountinfo. These days you should probably use openat2() with RESOLVE_NO_XDEV. No need for any mountinfo or anything like that. Just look up the pathname and say "don't cross mount-points", and you'll get an error if it's a mount crossing lookup. So this kind of thing is _not_ an argument for another kernel querying interface. We got a new (and better) model for a lot of this. Linus