All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Karel Zak <kzak@redhat.com>, Miklos Szeredi <miklos@szeredi.hu>,
	Ian Kent	 <raven@themaw.net>, Josef Bacik <josef@toxicpanda.com>,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH v3 0/2] fs: allow statmount to fetch the subtype and devname
Date: Tue, 12 Nov 2024 06:33:27 -0500	[thread overview]
Message-ID: <309c329dc3bab4ff8659fd7f1b48e7957aa32d80.camel@kernel.org> (raw)
In-Reply-To: <20241112-vielzahl-grasen-51280e378f23@brauner>

On Tue, 2024-11-12 at 10:42 +0100, Christian Brauner wrote:
> On Mon, Nov 11, 2024 at 08:42:26AM -0500, Jeff Layton wrote:
> > On Mon, 2024-11-11 at 10:17 +0100, Christian Brauner wrote:
> > > On Thu, 07 Nov 2024 16:00:05 -0500, Jeff Layton wrote:
> > > > Meta has some internal logging that scrapes /proc/self/mountinfo today.
> > > > I'd like to convert it to use listmount()/statmount(), so we can do a
> > > > better job of monitoring with containers. We're missing some fields
> > > > though. This patchset adds them.
> > > > 
> > > > 
> > > 
> > > I know Karel has been wanting this for libmount as well. Thanks for
> > > doing this! It would be nice if you could also add some selftests!
> > > 
> > 
> > (cc'ing Karel)
> > 
> > Thanks. We may need to tweak this a bit, based on Miklos' comments
> > about how empty strings are handled now, but it shouldn't be too big a
> > change.
> > 
> > I actually have a related question about libmount: glibc doesn't
> > currently provide syscall wrappers for statmount() and listmount().
> 
> I think it'll be a bit until glibc exposes those system calls because I
> think they are special-purpose in a lot of ways. But also because glibc
> usually takes a while to add new system call wrappers.
> 
> > Would it make sense to have libmount provide those? We could copy the
> 
> I think libmount may not necessarily provide direct syscall wrappers but
> will expose new api functionality. This is at least what I gather from
> all the discussions on util-linux.
> 
> > wrappers in tools/testing/selftests/filesystems/statmount/statmount.h
> > to libmount.h.
> > 
> > It's error-prone and a pain to roll these yourself, and that would make
> 
> As with most system calls.
> 
> > things simpler until someone is ready to do something for glibc.
> > 
> > Another idea might be to start a new userland header file that is just
> > a collection of static inline wrappers for syscalls that aren't
> > packaged in glibc.e.g.  pidfd_open also doesn't have glibc bindings, so
> > we could add that there too.
> 
> Oh? What glibc version are you on? pidfd_open() et al should all have
> glibc wrappers afaik. It just always takes a while:
> 
>         > cat /usr/include/x86_64-linux-gnu/sys/pidfd.h | grep pidfd
>         extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW;
>         extern int pidfd_getfd (int __pidfd, int __targetfd,
>         extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,
>         extern pid_t pidfd_getpid (int __fd) __THROW;

Ahh, I was trusting the manpage, which says:

       Note: glibc provides no wrapper for pidfd_open(), necessitating
the use of syscall(2).

It looks like recent glibc does have wrappers for this.
-- 
Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2024-11-12 11:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 21:00 [PATCH v3 0/2] fs: allow statmount to fetch the subtype and devname Jeff Layton
2024-11-07 21:00 ` [PATCH v3 1/2] fs: add the ability for statmount() to report the fs_subtype Jeff Layton
2024-11-11 10:49   ` Miklos Szeredi
2024-11-11 11:28     ` Jeff Layton
2024-11-11 13:01       ` Miklos Szeredi
2024-11-11 13:28         ` Jeff Layton
2024-11-11 13:30           ` Christian Brauner
2024-11-07 21:00 ` [PATCH v3 2/2] fs: add the ability for statmount() to report the mnt_devname Jeff Layton
2024-11-08 12:19   ` Jan Kara
2024-11-11 14:31   ` Miklos Szeredi
2024-11-11  9:17 ` [PATCH v3 0/2] fs: allow statmount to fetch the subtype and devname Christian Brauner
2024-11-11 13:42   ` Jeff Layton
2024-11-12  9:37     ` Karel Zak
2024-11-12  9:42     ` Christian Brauner
2024-11-12 10:24       ` Miklos Szeredi
2024-11-12 13:12         ` Christian Brauner
2024-11-12 11:33       ` Jeff Layton [this message]

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=309c329dc3bab4ff8659fd7f1b48e7957aa32d80.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=kzak@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=raven@themaw.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.