Linux-man Archive mirror
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Miklos Szeredi <mszeredi@redhat.com>, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	linux-man@vger.kernel.org, linux-security-module@vger.kernel.org,
	Karel Zak <kzak@redhat.com>, David Howells <dhowells@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <christian@brauner.io>,
	Amir Goldstein <amir73il@gmail.com>,
	Matthew House <mattlloydhouse@gmail.com>,
	Florian Weimer <fweimer@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v4 0/6] querying mount attributes
Date: Wed, 1 Nov 2023 19:52:45 +0800	[thread overview]
Message-ID: <374433e3-ab72-64a3-0fa0-ab455268e5e0@themaw.net> (raw)
In-Reply-To: <20231025140205.3586473-1-mszeredi@redhat.com>

On 25/10/23 22:01, Miklos Szeredi wrote:
> Implement mount querying syscalls agreed on at LSF/MM 2023.
>
> Features:
>
>   - statx-like want/got mask
>   - allows returning ascii strings (fs type, root, mount point)
>   - returned buffer is relocatable (no pointers)
>
> Still missing:
>   - man pages
>   - kselftest
>
> Please find the test utility at the end of this mail.
>
>    Usage: statmnt [-l|-r] [-u] (mnt_id|path)
>
> Git tree:
>
>    git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git#statmount-v4
>
>
> Changes v3..v4:
>
>   - incorporate patch moving list of mounts to an rbtree
>   - wire up syscalls for all archs
>   - add LISTMOUNT_RECURSIVE (depth first iteration of mount tree)
>   - add LSMT_ROOT (list root instead of a specific mount ID)
>   - list_for_each_entry_del() moved to a separate patchset
>
> Changes v1..v3:
>
>   - rename statmnt(2) -> statmount(2)
>   - rename listmnt(2) -> listmount(2)
>   - make ABI 32bit compatible by passing 64bit args in a struct (tested on
>     i386 and x32)
>   - only accept new 64bit mount IDs
>   - fix compile on !CONFIG_PROC_FS
>   - call security_sb_statfs() in both syscalls
>   - make lookup_mnt_in_ns() static
>   - add LISTMOUNT_UNREACHABLE flag to listmnt() to explicitly ask for
>     listing unreachable mounts
>   - remove .sb_opts
>   - remove subtype from .fs_type
>   - return the number of bytes used (including strings) in .size
>   - rename .mountpoint -> .mnt_point
>   - point strings by an offset against char[] VLA at the end of the struct.
>     E.g. printf("fs_type: %s\n", st->str + st->fs_type);
>   - don't save string lengths
>   - extend spare space in struct statmnt (complete size is now 512 bytes)
>
>
> Miklos Szeredi (6):
>    add unique mount ID
>    mounts: keep list of mounts in an rbtree
>    namespace: extract show_path() helper
>    add statmount(2) syscall
>    add listmount(2) syscall
>    wire up syscalls for statmount/listmount
>
>   arch/alpha/kernel/syscalls/syscall.tbl      |   3 +
>   arch/arm/tools/syscall.tbl                  |   3 +
>   arch/arm64/include/asm/unistd32.h           |   4 +
>   arch/ia64/kernel/syscalls/syscall.tbl       |   3 +
>   arch/m68k/kernel/syscalls/syscall.tbl       |   3 +
>   arch/microblaze/kernel/syscalls/syscall.tbl |   3 +
>   arch/mips/kernel/syscalls/syscall_n32.tbl   |   3 +
>   arch/mips/kernel/syscalls/syscall_n64.tbl   |   3 +
>   arch/mips/kernel/syscalls/syscall_o32.tbl   |   3 +
>   arch/parisc/kernel/syscalls/syscall.tbl     |   3 +
>   arch/powerpc/kernel/syscalls/syscall.tbl    |   3 +
>   arch/s390/kernel/syscalls/syscall.tbl       |   3 +
>   arch/sh/kernel/syscalls/syscall.tbl         |   3 +
>   arch/sparc/kernel/syscalls/syscall.tbl      |   3 +
>   arch/x86/entry/syscalls/syscall_32.tbl      |   3 +
>   arch/x86/entry/syscalls/syscall_64.tbl      |   2 +
>   arch/xtensa/kernel/syscalls/syscall.tbl     |   3 +
>   fs/internal.h                               |   2 +
>   fs/mount.h                                  |  27 +-
>   fs/namespace.c                              | 573 ++++++++++++++++----
>   fs/pnode.c                                  |   2 +-
>   fs/proc_namespace.c                         |  13 +-
>   fs/stat.c                                   |   9 +-
>   include/linux/mount.h                       |   5 +-
>   include/linux/syscalls.h                    |   8 +
>   include/uapi/asm-generic/unistd.h           |   8 +-
>   include/uapi/linux/mount.h                  |  65 +++
>   include/uapi/linux/stat.h                   |   1 +
>   28 files changed, 635 insertions(+), 129 deletions(-)

Looks ok to me,covers the primary cases I needed when I worked

on using fsinfo() in systemd.


Karel, is there anything missing you would need for adding

libmount support?


Reviewed-by: Ian Kent <raven@themaw.net>


>

  parent reply	other threads:[~2023-11-01 11:53 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 14:01 [PATCH v4 0/6] querying mount attributes Miklos Szeredi
2023-10-25 14:01 ` [PATCH v4 1/6] add unique mount ID Miklos Szeredi
2023-10-25 14:02 ` [PATCH v4 2/6] mounts: keep list of mounts in an rbtree Miklos Szeredi
2023-10-27  3:11   ` Ian Kent
2023-10-27  8:17     ` Miklos Szeredi
2023-10-28  1:36       ` Ian Kent
2023-10-30  5:37         ` Ian Kent
2023-10-30  5:45           ` Ian Kent
2023-10-30  9:06             ` Miklos Szeredi
2023-10-31  1:23               ` Ian Kent
2023-10-25 14:02 ` [PATCH v4 3/6] namespace: extract show_path() helper Miklos Szeredi
2023-10-25 14:02 ` [PATCH v4 4/6] add statmount(2) syscall Miklos Szeredi
2023-11-08  2:58   ` Paul Moore
2023-11-08  7:58     ` Christian Brauner
2023-11-08 20:10       ` Paul Moore
2023-11-10 17:00         ` Paul Moore
2023-11-12 13:05           ` Christian Brauner
2023-11-12 20:29             ` Paul Moore
2023-10-25 14:02 ` [PATCH v4 5/6] add listmount(2) syscall Miklos Szeredi
2023-11-07 21:23   ` Jonathan Corbet
2023-11-08  7:53     ` Christian Brauner
2023-11-08 16:20       ` Jonathan Corbet
2023-11-08 16:23         ` Christian Brauner
2023-11-08  2:58   ` Paul Moore
2024-01-10 22:23   ` Guenter Roeck
2024-01-11  0:32     ` Linus Torvalds
2024-01-11  5:12       ` Guenter Roeck
2024-01-11 18:57       ` Guenter Roeck
2024-01-11 20:14         ` Linus Torvalds
2024-01-11 23:01           ` Arnd Bergmann
2024-01-11 23:57           ` Guenter Roeck
2024-01-12  3:40             ` Linus Torvalds
2024-01-12  5:24               ` Guenter Roeck
2024-01-12  9:00           ` Christian Brauner
2024-01-23 14:14     ` John Paul Adrian Glaubitz
2024-01-23 15:31       ` Guenter Roeck
2024-01-23 14:14     ` John Paul Adrian Glaubitz
2023-10-25 14:02 ` [PATCH v4 6/6] wire up syscalls for statmount/listmount Miklos Szeredi
2024-01-09  1:11   ` Florian Fainelli
2023-11-01 11:13 ` [PATCH v4 0/6] querying mount attributes Christian Brauner
2023-11-01 13:18   ` Miklos Szeredi
2023-11-01 15:54     ` Christian Brauner
2023-11-01 11:52 ` Ian Kent [this message]
2023-11-06 12:10   ` Karel Zak
2023-11-06 13:33     ` Amir Goldstein
2023-11-07  0:47       ` Ian Kent
2023-11-06 23:54     ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=374433e3-ab72-64a3-0fa0-ab455268e5e0@themaw.net \
    --to=raven@themaw.net \
    --cc=amir73il@gmail.com \
    --cc=arnd@arndb.de \
    --cc=christian@brauner.io \
    --cc=dhowells@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=kzak@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mattlloydhouse@gmail.com \
    --cc=mszeredi@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).