Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3112791ybb; Mon, 6 Apr 2020 02:17:58 -0700 (PDT) X-Google-Smtp-Source: APiQypJdCK8XfzFJmotM/Lccob01sMpoknMuVzZ/TRijE6hGRC/0SOeuR7TVDWknz/gl0z9RK1Jo X-Received: by 2002:a9d:837:: with SMTP id 52mr15929216oty.354.1586164678219; Mon, 06 Apr 2020 02:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586164678; cv=none; d=google.com; s=arc-20160816; b=lmQXUmJKvfhj7QyyjDMpqsDRDOh7CoN7KcDgUjtkGR198ynTh3ue1ZIQ9ZbPf1XDQ6 qku3DeSmJhngDms6mzgoq9H8wOFrhEyHiav2Ft2r6ea4bc3PQ8dxqT4Bt8/EUY1JeNx6 5hZk0FJmlSHdvzw7X0NivMbOdDt4b3ezX5PEpWZ0KdcG3EV/xx5SHUuwBYjyEb0w45FQ QqRB1nQuN6HaZjxvCY+Ch92B4H/kb3b9/7kx19GzLbpG/xLsbHcjUIpuqMASIKO28mCh gD5ekO68UQoJp8kAVNiO3oVlzEzJnP0rtzt8s+XHZh8pJatye26YAVctVcafQcU8T5XU 6djw== 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=NEV7TR1aEEGU9BOd+7WjT2xwDzuljghXSkqCe1NlNsM=; b=03QHFmklCUADC7l0NDXXiLZq4n0QLE6LVbqXtRqM0y7Ofbl8+h29ZYHaXIf1b+QO67 ubo53WPykSHqg9uZIsH+GwF3etc6C4Au7swzyRZo4iqbbAr7QOc8ZKJcA7WVwvB6ymUk Ckkh4hQKY1CTTmLzDjMM+RSYyLHjhmi/CGU2BEFCPT2xTiL7+Srvfn7/sxjWmLLOUF/P zpexwUKzC/PpwTnb241LMUkuaWMGqdOb4WI4E+EokbSji9JMTGppUn+l4Nf2l3i59+jt btKsLoeXdcbAMlXGRHjeDjY5p76S7OoGr0Cq82NAAjr4nIdrEUOUgmAYZpxZ3NgbKTzt RpTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Eqi2YJpN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u28si8575693otg.14.2020.04.06.02.17.46; Mon, 06 Apr 2020 02:17:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Eqi2YJpN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727045AbgDFJRP (ORCPT + 99 others); Mon, 6 Apr 2020 05:17:15 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21258 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726663AbgDFJRP (ORCPT ); Mon, 6 Apr 2020 05:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586164633; 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=NEV7TR1aEEGU9BOd+7WjT2xwDzuljghXSkqCe1NlNsM=; b=Eqi2YJpNDhiYyJay6FqjX6ZdxeyiTg/Fo13Jd5D+Rm/vLnJL+fDId0gG+IUiSSi36oqMdv W3547tRt61ZAIw5z3DE26e8Q60d07zA4xLXk7Rop+M6ur29Xt3fvVnk7DuUOLC9SvdLhGM SnsokAvWBN10ryzjxGV0nM83pcThajM= 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-330-mxPGqf0zPReDwLyoyVPcDA-1; Mon, 06 Apr 2020 05:17:10 -0400 X-MC-Unique: mxPGqf0zPReDwLyoyVPcDA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04F15100551A; Mon, 6 Apr 2020 09:17:08 +0000 (UTC) Received: from ws.net.home (unknown [10.40.194.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1334A60BFB; Mon, 6 Apr 2020 09:17:03 +0000 (UTC) Date: Mon, 6 Apr 2020 11:17:01 +0200 From: Karel Zak To: "J. Bruce Fields" Cc: Lennart Poettering , Miklos Szeredi , Ian Kent , David Howells , Christian Brauner , Linus Torvalds , Al Viro , dray@redhat.com, Miklos Szeredi , Steven Whitehouse , Jeff Layton , andres@anarazel.de, keyrings@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksa Sarai Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() Message-ID: <20200406091701.q7ctdek2grzryiu3@ws.net.home> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403203024.GB27105@fieldses.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 03, 2020 at 04:30:24PM -0400, J. Bruce Fields wrote: > On Fri, Apr 03, 2020 at 05:12:23PM +0200, Lennart Poettering wrote: > > BTW, while we are at it: one more thing I'd love to see exposed by > > statx() is a simple flag whether the inode is a mount point. There's > > plenty code that implements a test like this all over the place, and > > it usually isn't very safe. There's one implementation in util-linux > > for example (in the /usr/bin/mountpoint binary), and another one in > > systemd. Would be awesome to just have a statx() return flag for that, > > that would make things *so* much easier and more robust. because in > > fact most code isn't very good that implements this, as much of it > > just compares st_dev of the specified file and its parent. Better code > > compares the mount ID, but as mentioned that's not as pretty as it > > could be so far... > > 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. > So anyway, yes, everybody reinvents the wheel here, and this would be > useful. +1 Karel -- Karel Zak http://karelzak.blogspot.com