Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5815413rdb; Sun, 17 Sep 2023 13:52:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrCkRG5IrDxb29GeXUFdLx0rnfQqb5CJSVHmvexrapPxH7fPDOUEz9NWWW9K1o4Ume4sWI X-Received: by 2002:a05:6a20:1608:b0:159:c918:1016 with SMTP id l8-20020a056a20160800b00159c9181016mr7190159pzj.49.1694983921304; Sun, 17 Sep 2023 13:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694983921; cv=none; d=google.com; s=arc-20160816; b=f79EK/PwYz0FXAI6l12vwuAm7VY2Lk9ZR9uZJfg4rNhMNiUh7qzxV6rmDNucEZ2tWq xGhi469q9FSBUXjNTfeiuAlLpztVXeP+xu9R+Thl5GHxf/YCxxSSqnfOrgcKpVhMvOpe dM1KqE0vHH1Y+HDQSRKHNa7QNj+CPWKEV0kreo9vjjG2yhJFJ03LVVoNinVmkl3rjG14 Am3aBX/vb4wjSLJ8elxiaD3loZtsp8nWdYedwCmpHKz8KaFgBZbpMfDsUDU3MyED6NWp UOJQsC+/S0gBssTNOSgBA2gpuBYhb2dcLF0AMuM1rr6qGlva4bYXsNGg2PhwPsVBfs86 qyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=L+GZybm26Jw3S/QLqnyCqrZ/lHqylFFuVPFliXlkHwI=; fh=14v87RRXjl/VdxG3aUgRI2BfotRSCP+R/H2CRFTM2BE=; b=gldAQ2vy1dBtE9EyJp5cRCMGOEv+nUKY/dxSVkdeL53LQN4FUtYYn1/+i/uYa+b1Zq RrKHM+S8kJTTGlBnLrnflrYROpw+Z2O0gJc+RNlWv3sJ904w5GXowJwsko+Zpb2OPgmV kvZXtrmO2fXRmi/tAoKxMYAgt+c7UeEExPJZtcKveXxQa8VFaihtIZ1b7vP5BDEhVBMK T/ru3lQAw6b1N3YerCI3CCG5emk5OT1NVNOcLT65VAsiOdO5Xr1L6+NHnOv5VES3ob5A eOQNA/wEuIhp8orHxfGsCGJsj4RBo3e4XqLnr9oeBNTdm0IwL7hy9sa7Ipkq7sW8mvMX ix4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=daFPiJ5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sargun.me Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d15-20020a170902654f00b001bc67506b38si6870596pln.367.2023.09.17.13.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 13:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=daFPiJ5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sargun.me Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 45C67802947E; Sun, 17 Sep 2023 11:19:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236836AbjIQSTE (ORCPT + 99 others); Sun, 17 Sep 2023 14:19:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238517AbjIQSTA (ORCPT ); Sun, 17 Sep 2023 14:19:00 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA460130 for ; Sun, 17 Sep 2023 11:18:53 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2bcbfb3705dso60818061fa.1 for ; Sun, 17 Sep 2023 11:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; t=1694974732; x=1695579532; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L+GZybm26Jw3S/QLqnyCqrZ/lHqylFFuVPFliXlkHwI=; b=daFPiJ5BccJge9gfdHPZsr+R09O6Y2XqKNPQeAONPglVjQlaqkK66Dn5W8SjF99GsN Dc6GxcyHHlnlU7tVdPYhvDsMOQoqHwC2nsEFM1ig5SfrpY/Z1r0Mk8F7OimPLVLF9nCj qKxTPDv8XJ2nQi6o/lgPIfiSwZRqvXoksRFIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694974732; x=1695579532; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L+GZybm26Jw3S/QLqnyCqrZ/lHqylFFuVPFliXlkHwI=; b=AFlaMXRyxINXUGkQaIrI7chaFMZYqdwBfPvlkR2y2HYenlQBJczrfqg08OmaXB8BHf CL4sPR8DAdRmqMJmpesIYv9VR5hjgpnjUeejYDt03gOWNUS19PtbpLXWg/aBw5Owuea0 WD6gYHKjYxTRQyKC8EMsZxghP/8LaAsClEUkn2XCBJyZ8setamknmm/ff1MqCfHpxJv7 PnKpcb+qW8bg3zYhUNqtAz6QWi65tpuxNXIdPnyQrrXZ85+AeK/IvnCn9nSwT52w2rH1 YVzdKB8ua8DExDosmA4YAY1v+An/5ze9AA2Vpe8VrZsBHyCy8cRtdAsCzVjyTjzvkPyG cPNg== X-Gm-Message-State: AOJu0YwaqbuKhmR2VpZgoXDG8+YAakCv8vU7CnR0NthWyfTPE+HPGImC TNAEb8IiozipRz6709nJXUp/KCSiW1jt5yETe/ilYA== X-Received: by 2002:a2e:b98b:0:b0:2c0:d06:9e6b with SMTP id p11-20020a2eb98b000000b002c00d069e6bmr562052ljp.33.1694974731628; Sun, 17 Sep 2023 11:18:51 -0700 (PDT) MIME-Version: 1.0 References: <20230913152238.905247-1-mszeredi@redhat.com> <20230913152238.905247-3-mszeredi@redhat.com> In-Reply-To: <20230913152238.905247-3-mszeredi@redhat.com> From: Sargun Dhillon Date: Sun, 17 Sep 2023 12:18:15 -0600 Message-ID: Subject: Re: [RFC PATCH 2/3] add statmnt(2) syscall To: 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 , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sun, 17 Sep 2023 11:19:47 -0700 (PDT) On Wed, Sep 13, 2023 at 9:25=E2=80=AFAM Miklos Szeredi wrote: > > Add a way to query attributes of a single mount instead of having to pars= e > 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 que= ry > 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 ge= ts > 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 p= er > above suggestion). Allow querying multiple string attributes with > individual offset/length for each. String are nul terminated (terminatio= n > isn't counted in length). > > Mount options are also delimited with nul characters. Unlike proc, speci= al > characters are not quoted. > Thank you for writing this patch. I wish that this had existed the many tim= es 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?