From: Christian Brauner <brauner@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Florian Weimer <fweimer@redhat.com>,
libc-alpha@sourceware.org, linux-man <linux-man@vger.kernel.org>,
Alejandro Colomar <alx@kernel.org>,
Linux API <linux-api@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, Karel Zak <kzak@redhat.com>,
Ian Kent <raven@themaw.net>, David Howells <dhowells@redhat.com>,
Christian Brauner <christian@brauner.io>,
Amir Goldstein <amir73il@gmail.com>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: proposed libc interface and man page for statmount(2)
Date: Mon, 20 Nov 2023 16:38:05 +0100 [thread overview]
Message-ID: <20231120-wachhalten-darfst-ed3244509881@brauner> (raw)
In-Reply-To: <ZVtEkeTuqAGG8Yxy@maszat.piliscsaba.szeredi.hu>
On Mon, Nov 20, 2023 at 12:55:17PM +0100, Miklos Szeredi wrote:
> On Fri, Nov 17, 2023 at 04:50:25PM +0100, Miklos Szeredi wrote:
> > I wonder... Is there a reason this shouldn't be done statelessly by
> > adding an "continue after this ID" argument to listmount(2)? The
> > caller will just need to pass the last mount ID received in the array
> > to the next listmount(2) call and iterate until a short count is
> > returned.
>
> No comments so far... maybe more explanation is needed.
>
> New signature of listmount() would be:
>
> ssize_t listmount(uint64_t mnt_id, uint64_t last_mnt_id,
> uint64_t *buf, size_t bufsize, unsigned int flags);
>
> And the usage would be:
>
> for (last = 0; nres == bufsize; last = buf[bufsize-1]) {
> nres = listmount(parent, last, buf, bufsize, flags);
> for (i = 0; i < nres; i++) {
> /* process buf[i] */
> }
> }
>
>
> Here's a kernel patch against the version in Christian's tree. The syscall
> signature doesn't need changing, since we have a spare u64 in the mnt_id_req for
> listmount.
>
> The major difference is in the order that the mount ID's are listed, which is
> now strictly increasing. Doing the recursive listing in DFS order is nicer, but
> I don't think it's important enough.
>
> Comments?
Sure. We can also add a size argument to struct mnt_id_req then you can
version it by size and extend it easily later (see sched_{g,s}etattr()
that do similar things):
struct mnt_id_req {
__u32 size;
__u64 mnt_id;
__u64 request_mask;
union {
__u64 request_mask;
__u64 last_mnt_id;
};
};
foo(struct mnt_id_req __user *ureq)
{
u32 size;
struct mnt_id_req kreq;
ret = get_user(size, &ureq->size);
if (ret)
return ret;
if (size < MNT_ID_REQ_SIZE_VER0 || size > PAGE_SIZE)
return -EINVAL;
ret = copy_struct_from_user(&kreq, sizeof(kreq), ureq, size);
if (ret)
return ret;
}
next prev parent reply other threads:[~2023-11-20 15:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 15:08 proposed libc interface and man page for statmount(2) Miklos Szeredi
2023-11-16 20:12 ` Adhemerval Zanella Netto
2023-11-16 20:36 ` Florian Weimer
2023-11-16 21:01 ` Miklos Szeredi
2023-11-17 14:22 ` Miklos Szeredi
2023-11-17 14:47 ` Florian Weimer
2023-11-17 15:13 ` Miklos Szeredi
2023-11-17 15:50 ` Miklos Szeredi
2023-11-20 11:55 ` Miklos Szeredi
2023-11-20 12:16 ` Florian Weimer
2023-11-20 12:34 ` Miklos Szeredi
2023-11-20 23:56 ` Ian Kent
2023-11-21 0:58 ` Ian Kent
2023-11-21 1:12 ` Ian Kent
2023-11-21 1:33 ` Ian Kent
2023-11-21 19:42 ` Miklos Szeredi
2023-11-21 20:42 ` Zack Weinberg
2023-11-21 23:28 ` Ian Kent
2023-11-22 16:18 ` Zack Weinberg
2023-11-21 23:07 ` Ian Kent
2023-11-22 10:18 ` Christian Brauner
2023-11-20 15:38 ` Christian Brauner [this message]
2023-11-20 15:30 ` Christian Brauner
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=20231120-wachhalten-darfst-ed3244509881@brauner \
--to=brauner@kernel.org \
--cc=alx@kernel.org \
--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=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=raven@themaw.net \
/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