Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5901669rdb; Sun, 17 Sep 2023 18:41:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/YBDjStMWfIFuMgXxh8eVbUO2PstGO42VgQcC26OEDxPoRkOo9CiAxBYW1iik6qgyh5gn X-Received: by 2002:a17:903:2586:b0:1bc:1189:17f with SMTP id jb6-20020a170903258600b001bc1189017fmr6404758plb.42.1695001276594; Sun, 17 Sep 2023 18:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695001276; cv=none; d=google.com; s=arc-20160816; b=amscVgTAni/L8TYAVbIw0X2pqtm9Lj6OGXGPChAgP/J9wmlWQuEb5gL5Yt4SynwZZy XVWJQHSEvG2VylfxjqS58+a1PqUewLooaonLcAaBtz/25NIdeHbs85rJ7Wl2el9M/3Nw xYzlEMjQGLCZcQRGc+4qqirO7lBFWwPIkCFw7E+aq/rIsj7BiHQ+5GmVLI8TThN/Kbx9 jObVPJVbAdRBTFwYYa0BC4JPpiAVnNSG0XPYXbdpGJu3KE/mzAqLm2bm+zDy0LgziBW8 +koeeca/P0P90RpFIB2F8zBhh5qum7U1kteZJoOcZDZSo2yLSBZHvDU6RmOo0taBeUj6 e6+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=bsWkcg3PjB3+b+dNWVfXA89yUdcxjWyNUMed18WGUnc=; fh=oW1YuC+WLFamuZRjedNl3/1LN2Ps/8iteC31N439ndc=; b=MQWNPD7Wwmwv9YRI5YBW4a58Qconxhwa0MKuHXpMk1WMKia+U3ArC98aqkxp/lO4Fp M5EDcHBG9TZ5OiBlfL2Mi4D9CFtfZmdqY0bqXokUvfRBldiSZRCyQ/JlpAAyxVOU9xoz bWbeCKvh9HvzNxVpW7I4j0+bp6J7F2af/2sEEutar0QOnTLkA8HyVUtJT2qSTCvkDBZv BQp22o0rKijiGwCZSzVh5T59HE+T5FbR+4xH9rBzyqLJzUf/iC6w595IrljRLIB0L0Ga G/zLTaXQMicFJCSni58en5+3ob+SG3lp7lizPK+96507zFjz9pSX/A8HeUAnY4plQgMP qG8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm1 header.b=lrRwu3S+; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Rj/z+rjP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j3-20020a170903028300b001c43cd543a0si4733998plr.241.2023.09.17.18.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 18:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@themaw.net header.s=fm1 header.b=lrRwu3S+; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Rj/z+rjP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 30A9F80DA99E; Sun, 17 Sep 2023 16:37:48 -0700 (PDT) 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 S232351AbjIQXhM (ORCPT + 99 others); Sun, 17 Sep 2023 19:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231518AbjIQXg4 (ORCPT ); Sun, 17 Sep 2023 19:36:56 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E303910C; Sun, 17 Sep 2023 16:36:49 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4FFE75C00A8; Sun, 17 Sep 2023 19:36:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 17 Sep 2023 19:36:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1694993807; x=1695080207; bh=bsWkcg3PjB3+b+dNWVfXA89yUdcxjWyNUMe d18WGUnc=; b=lrRwu3S+XAYckx49cIDZjNN29bad41IEY462IVLF2LJkJUiYTZa I1vTukzn0B1268av/IvWTc3uda8RDon40kPUaVJV0f/5cNDm/HTnFUM2elDZaFqn lzw+AMENiMlCaT/30PfY+tBzPKajCLjnBopqkzqqP/hmQXgcX0XsAE9GiptlivMM XC4DlY8S6SOhlzSQUvjSZ3+x0zWssmRzrcUcHiCO7GDE7k7FSv1NN3u46L/PvIwg QYnTkTnlsz258WKatUhrsKCw+SLh6rcbwI6CfCP9Us4IcuaQQDAuh4PsvXdA84Ej y86nzGT6d0D/gpL9oAhX6XIgCKaoPNbUMBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694993807; x=1695080207; bh=bsWkcg3PjB3+b+dNWVfXA89yUdcxjWyNUMe d18WGUnc=; b=Rj/z+rjPwTQfwEpdoaDwvZI6BE5p7/jDNgWtsr8KSEgzZd3qtKV gAw5/R06eipJuYiLq2CT3p2LQ3BDYhBrGvoOgxTzygYNU+LOS3AiIbNG5CbjYRX8 jiotAvXKxoSbGTOTozIDvM1UliKeeNDOpHeEGrXTyATnvq2PrzKQq+f3LWtl4WYx cunESBi3ieoMu3Q10D+rLAXvDMiwIr2+HHu1QG+7sIGtd1xLQGcZIrqx6eIcn/TR iwGRm+BQyeqaeg/HpepSXRVw7R8qwS3iLluVPanK+5tZyQoNzsJ1NoHPB3itstn0 MDkngzeckr2eQQBRed7Kd+Wa15K99kbcF3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejjedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefkrghn ucfmvghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecuggftrfgrthhtvghrnh epgedvteevvdefiedvueeujeegtedvheelhfehtefhkefgjeeuffeguefgkeduhfejnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgrvhgvnh esthhhvghmrgifrdhnvght X-ME-Proxy: Feedback-ID: i31e841b0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Sep 2023 19:36:41 -0400 (EDT) Message-ID: <39dc7081-fef3-007b-eee3-273bff549ecf@themaw.net> Date: Mon, 18 Sep 2023 07:36:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH 2/3] add statmnt(2) syscall Content-Language: en-US To: Sargun Dhillon , Miklos Szeredi Cc: 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, Karel Zak , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein References: <20230913152238.905247-1-mszeredi@redhat.com> <20230913152238.905247-3-mszeredi@redhat.com> From: Ian Kent In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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]); Sun, 17 Sep 2023 16:37:48 -0700 (PDT) On 18/9/23 02:18, Sargun Dhillon wrote: > On Wed, Sep 13, 2023 at 9:25 AM Miklos Szeredi wrote: >> Add a way to query attributes of a single mount instead of having to parse >> the complete /proc/$PID/mountinfo, which might be huge. >> >> Lookup the mount by the old (32bit) or new (64bit) mount ID. If a mount >> needs to be queried based on path, then statx(2) can be used to first query >> the mount ID belonging to the path. >> >> Design is based on a suggestion by Linus: >> >> "So I'd suggest something that is very much like "statfsat()", which gets >> a buffer and a length, and returns an extended "struct statfs" *AND* >> just a string description at the end." >> >> The interface closely mimics that of statx. >> >> Handle ASCII attributes by appending after the end of the structure (as per >> above suggestion). Allow querying multiple string attributes with >> individual offset/length for each. String are nul terminated (termination >> isn't counted in length). >> >> Mount options are also delimited with nul characters. Unlike proc, special >> characters are not quoted. >> > Thank you for writing this patch. I wish that this had existed the many times > I've written parsers for mounts files in my life. > > What do you think about exposing the locked flags, a la what happens > on propagation of mount across user namespaces? Which flags do you mean? If you mean shared, slave and I think there's a group id as well, etc. then yes they were available in the original fsinfo() implementation as they were requested. So, yes, it would be good to also include those too. Ian