Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2073679rdf; Mon, 6 Nov 2023 04:12:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlmm8K0wHAgKtLWpsxEz1gnrkGVAXTShJpjE3nJYobCKrEOFBpUlLOZF1UwxHgdaZpaBRG X-Received: by 2002:a17:903:1246:b0:1c7:495c:87e0 with SMTP id u6-20020a170903124600b001c7495c87e0mr35064437plh.37.1699272726482; Mon, 06 Nov 2023 04:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699272726; cv=none; d=google.com; s=arc-20160816; b=IOaqA3TypC7TPZGbrPRCrPzmKhlovF9UzQMjirCeWN6WMHpsObAZgEBYqfinl/n7a8 TiHmp6Kam1NWmNw9UV9vMcm6J2uhSOA/cN/9UQpsupmUJ3LMp6unBRTQjYWdonJnn4/3 7Sh/gv/S/49hVhWpn3pDIxbdovzPGjRLcG8h91lMkkNOoSCazzkjHWW9pPEq58ExLKOq WhrVxmVlpV9DfsL+YLMYuhtb8DeMqyv4krvdkplxC3KFjBIpuupbGv21Dj3+6EGzca6T qsrRibCoos2IH3pgmcvpT+9nu6ZRb7+b4dD3zMLueBlmKDEayCpS7QjHDeEuVo1Kuq0E Rg+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bFqlESwPJo1XpM6rSXjb9JYObqnfNl5+smLVo9k46Wo=; fh=7Ty9NjIj86yxHAZrnbe2aplWxC47JtNHLvOkfhIn6vQ=; b=GYYBbgk0FIdzT1hw+WnAm2GPg0Ytod7cMv+CXpm1Of7BCcs2U2PSGQQT+SBbMnVScE gLi0Ibz2u7ellaE02sqyIVitaqmvFp5A0e7+6o1rUD4XOZUcHDHR3fVdQ4dgIBYfLZlS Kp2xph74oAvovWTYvNIrAkHDf1g3vwnXnYPyoOk7Un9yiw1XaPc70wbB7bgWH0WW534R Jq48xCm+kwk2tKIPShJHH7AQhWl8wIpFFJzTQX1re1XXxqjVyqBHJ6m1MYW4CyGiuvt3 xuys9d9zSapbE4Iq0Bye+FmZiJvadLo/O4hxtCN5AboqJf+NupE6QgjIvm6cuYK2AJpf ewFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YSVmI81I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n15-20020a170902d2cf00b001cc51ee5fb1si8537173plc.585.2023.11.06.04.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 04:12:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YSVmI81I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E0EAF807F2BD; Mon, 6 Nov 2023 04:12:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjKFMLx (ORCPT + 99 others); Mon, 6 Nov 2023 07:11:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjKFMLw (ORCPT ); Mon, 6 Nov 2023 07:11:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 274A31981 for ; Mon, 6 Nov 2023 04:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699272661; 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=bFqlESwPJo1XpM6rSXjb9JYObqnfNl5+smLVo9k46Wo=; b=YSVmI81IaDQfvpnUuSMLcJqlfYN/rZVJMMXhiHdkaJNqbY1NdhLcAp03a/neBcWWcj821f ty0HZQi4Hvr6FdEL3PETzm7P3iK4Zn+gxEjeCppeEUmRE1GmXOIKi3+TNzCJ4P7eEbKwY1 wpLC/L10mbz/e1IhAXgy1tVXvZXZJvg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-55-UylgK2iQOROjE5ju1YmJxw-1; Mon, 06 Nov 2023 07:10:58 -0500 X-MC-Unique: UylgK2iQOROjE5ju1YmJxw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E7C7185A781; Mon, 6 Nov 2023 12:10:57 +0000 (UTC) Received: from ws.net.home (unknown [10.45.226.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EC66492BE0; Mon, 6 Nov 2023 12:10:55 +0000 (UTC) Date: Mon, 6 Nov 2023 13:10:53 +0100 From: Karel Zak To: Ian Kent Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , Matthew House , Florian Weimer , Arnd Bergmann Subject: Re: [PATCH v4 0/6] querying mount attributes Message-ID: <20231106121053.egamth3hr7zcfzji@ws.net.home> References: <20231025140205.3586473-1-mszeredi@redhat.com> <374433e3-ab72-64a3-0fa0-ab455268e5e0@themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <374433e3-ab72-64a3-0fa0-ab455268e5e0@themaw.net> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 04:12:04 -0800 (PST) On Wed, Nov 01, 2023 at 07:52:45PM +0800, Ian Kent wrote: > On 25/10/23 22:01, Miklos Szeredi wrote: > Looks ok to me,covers the primary cases I needed when I worked > on using fsinfo() in systemd. Our work on systemd was about two areas: get mount info (stat/listmount() now) from the kernel, and get the mount ID from notification. There was watch_queue.h with WATCH_TYPE_MOUNT_NOTIFY and struct mount_notification->auxiliary_mount (aka mount ID) and event subtype to get the change status (new mount, umount, etc.) For example David's: https://patchwork.kernel.org/project/linux-security-module/patch/155991711016.15579.4449417925184028666.stgit@warthog.procyon.org.uk/ Do we have any replacement for this? > Karel, is there anything missing you would need for adding > libmount support? Miklos's statmount() and listmount() API is excellent from my point of view. It looks pretty straightforward to use, and with the unique mount ID, it's safe too. It will be ideal for things like umount(8) (and recursive umount, etc.). For complex scenarios (systemd), we need to get from the kernel the unique ID's after any change in the mount table to save resources and call statmount() only for the affected mount node. Parse mountinfo sucks, call for(listmount(-1)) { statmount() } sucks too :-) Karel -- Karel Zak http://karelzak.blogspot.com