From: Christian Brauner <christian.brauner@ubuntu.com>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk,
linux-api@vger.kernel.org, raven@themaw.net, mszeredi@redhat.com,
christian@brauner.io, jannh@google.com, darrick.wong@oracle.com,
kzak@redhat.com, jlayton@redhat.com,
linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/14] fsinfo: Add fsinfo() syscall to query filesystem information [ver #18]
Date: Tue, 10 Mar 2020 10:31:16 +0100 [thread overview]
Message-ID: <20200310093116.ylq6vaunr6js4eyy@wittgenstein> (raw)
In-Reply-To: <158376246603.344135.4335596732820276494.stgit@warthog.procyon.org.uk>
On Mon, Mar 09, 2020 at 02:01:06PM +0000, David Howells wrote:
> Add a system call to allow filesystem information to be queried. A request
> value can be given to indicate the desired attribute. Support is provided
> for enumerating multi-value attributes.
>
> ===============
> NEW SYSTEM CALL
> ===============
>
> The new system call looks like:
>
> int ret = fsinfo(int dfd,
> const char *pathname,
> const struct fsinfo_params *params,
> size_t params_size,
> void *result_buffer,
> size_t result_buf_size);
>
> The params parameter optionally points to a block of parameters:
>
> struct fsinfo_params {
> __u32 resolve_flags;
> __u32 flags;
> __u32 request;
> __u32 Nth;
> __u32 Mth;
> };
>
> If params is NULL, the default is that params->request is
> FSINFO_ATTR_STATFS and all the other fields are 0. params_size indicates
> the size of the parameter struct. If the parameter block is short compared
> to what the kernel expects, the missing length will be set to 0; if the
> parameter block is longer, an error will be given if the excess is not all
> zeros.
>
> The object to be queried is specified as follows - part param->flags
> indicates the type of reference:
>
> (1) FSINFO_FLAGS_QUERY_PATH - dfd, pathname and at_flags indicate a
> filesystem object to query. There is no separate system call
> providing an analogue of lstat() - RESOLVE_NO_TRAILING_SYMLINKS should
> be set in at_flags instead. RESOLVE_NO_TRAILING_AUTOMOUNTS can also
> be used to an allow automount point to be queried without triggering
> it.
>
> (2) FSINFO_FLAGS_QUERY_FD - dfd indicates a file descriptor pointing to
> the filesystem object to query. pathname should be NULL.
>
> (3) FSINFO_FLAGS_QUERY_MOUNT - pathname indicates the numeric ID of the
> mountpoint to query as a string. dfd is used to constrain which
> mounts can be accessed. If dfd is AT_FDCWD, the mount must be within
> the subtree rooted at chroot, otherwise the mount must be within the
> subtree rooted at the directory specified by dfd.
>
> (4) In the future FSINFO_FLAGS_QUERY_FSCONTEXT will be added - dfd will
> indicate a context handle fd obtained from fsopen() or fspick(),
> allowing that to be queried before the target superblock is attached
> to the filesystem or even created.
>
> params->request indicates the attribute/attributes to be queried. This can
> be one of:
>
> FSINFO_ATTR_STATFS - statfs-style info
> FSINFO_ATTR_IDS - Filesystem IDs
> FSINFO_ATTR_LIMITS - Filesystem limits
> FSINFO_ATTR_SUPPORTS - Support for statx, ioctl, etc.
> FSINFO_ATTR_TIMESTAMP_INFO - Inode timestamp info
> FSINFO_ATTR_VOLUME_ID - Volume ID (string)
> FSINFO_ATTR_VOLUME_UUID - Volume UUID
> FSINFO_ATTR_VOLUME_NAME - Volume name (string)
> FSINFO_ATTR_FSINFO_ATTRIBUTE_INFO - Information about attr Nth
> FSINFO_ATTR_FSINFO_ATTRIBUTES - List of supported attrs
>
> Some attributes (such as the servers backing a network filesystem) can have
> multiple values. These can be enumerated by setting params->Nth and
> params->Mth to 0, 1, ... until ENODATA is returned.
>
> result_buffer and result_buf_size point to the reply buffer. The buffer is
> filled up to the specified size, even if this means truncating the reply.
> The size of the full reply is returned, irrespective of the amount data
> that was copied. In future versions, this will allow extra fields to be
> tacked on to the end of the reply, but anyone not expecting them will only
> get the subset they're expecting. If either buffer of result_buf_size are
> 0, no copy will take place and the data size will be returned.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: linux-api@vger.kernel.org
You're missing to wire-up the syscall into the arm64 unistd32.h table
and this is all in one patch. I'd rather do it like we have done for all
other syscalls recently, and split this into:
- actual syscall implementation
- final wiring-up patch
Will make it easier to apply and spot merge conflicts when multiple
syscalls are proposed. I'm going to respond to this mail here with two
patches. One could replace this one I'm responding to and the other one
should probably go on top of the series.
(Please note that the same missing arm64 unistd32.h handling also likely
affects the watch syscalls as I haven't seen them in there when I added
fsinfo().)
next prev parent reply other threads:[~2020-03-10 9:31 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 14:00 [PATCH 00/14] VFS: Filesystem information [ver #18] David Howells
2020-03-09 14:00 ` [PATCH 01/14] VFS: Add additional RESOLVE_* flags " David Howells
2020-03-09 20:56 ` Stefan Metzmacher
2020-03-09 21:13 ` David Howells
[not found] ` <20200310005549.adrn3yf4mbljc5f6@yavin>
2020-03-10 1:14 ` Linus Torvalds
2020-03-10 7:25 ` David Howells
2020-03-11 17:59 ` Linus Torvalds
2020-03-12 9:08 ` Stefan Metzmacher
2020-03-12 16:24 ` Linus Torvalds
2020-03-12 16:56 ` David Howells
2020-03-12 18:09 ` Linus Torvalds
2020-03-12 17:11 ` Stefan Metzmacher
2020-03-12 19:37 ` Al Viro
2020-03-12 21:48 ` Jeremy Allison
[not found] ` <20200313095901.tdv4vl7envypgqfz@yavin>
2020-03-13 16:48 ` Jeremy Allison
2020-03-13 18:28 ` Al Viro
2020-03-13 18:35 ` Jeremy Allison
2020-03-16 14:20 ` Aleksa Sarai
2020-03-12 19:25 ` Al Viro
2020-03-09 14:01 ` [PATCH 02/14] fsinfo: Add fsinfo() syscall to query filesystem information " David Howells
2020-03-10 9:31 ` Christian Brauner [this message]
2020-03-10 9:32 ` [PATCH v19 01/14] fsinfo: Add fsinfo() syscall to query filesystem information Christian Brauner
2020-03-10 9:32 ` [PATCH v19 14/14] arch: wire up fsinfo syscall Christian Brauner
2020-03-09 14:01 ` [PATCH 03/14] fsinfo: Provide a bitmap of supported features [ver #18] David Howells
2020-03-09 14:01 ` [PATCH 04/14] fsinfo: Allow retrieval of superblock devname, options and stats " David Howells
2020-03-09 14:01 ` [PATCH 05/14] fsinfo: Allow fsinfo() to look up a mount object by ID " David Howells
2020-03-09 14:01 ` [PATCH 06/14] fsinfo: Add a uniquifier ID to struct mount " David Howells
2020-03-09 14:01 ` [PATCH 07/14] fsinfo: Allow mount information to be queried " David Howells
2020-03-10 9:04 ` Miklos Szeredi
2020-03-09 14:02 ` [PATCH 08/14] fsinfo: Allow the mount topology propogation flags to be retrieved " David Howells
2020-03-10 8:42 ` Christian Brauner
2020-03-09 14:02 ` [PATCH 09/14] fsinfo: Provide notification overrun handling support " David Howells
2020-03-09 14:02 ` [PATCH 10/14] fsinfo: sample: Mount listing program " David Howells
2020-03-09 14:02 ` [PATCH 11/14] fsinfo: Add API documentation " David Howells
2020-03-09 14:02 ` [PATCH 12/14] fsinfo: Add support for AFS " David Howells
2020-03-09 14:02 ` [PATCH 13/14] fsinfo: Example support for Ext4 " David Howells
2020-03-09 14:02 ` [PATCH 14/14] fsinfo: Example support for NFS " David Howells
2020-03-09 17:50 ` [PATCH 00/14] VFS: Filesystem information " Jeff Layton
2020-03-09 19:22 ` Andres Freund
2020-03-09 22:49 ` Jeff Layton
2020-03-10 0:18 ` Andres Freund
2020-03-09 20:02 ` Miklos Szeredi
2020-03-09 22:52 ` David Howells
2020-03-10 9:18 ` Miklos Szeredi
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=20200310093116.ylq6vaunr6js4eyy@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=christian@brauner.io \
--cc=darrick.wong@oracle.com \
--cc=dhowells@redhat.com \
--cc=jannh@google.com \
--cc=jlayton@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-security-module@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=raven@themaw.net \
--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