From: Christian Brauner <brauner@kernel.org>
To: Yann Droneaud <ydroneaud@opteya.com>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Carlos O'Donell <carlos@redhat.com>,
linux-api@vger.kernel.org,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v5 8/8] linux: Add mount_setattr
Date: Tue, 7 Jun 2022 20:10:32 +0200 [thread overview]
Message-ID: <20220607181032.s4rnqwxik7scuhzx@wittgenstein> (raw)
In-Reply-To: <5a3f8e2f-d67a-d1e1-c5a5-0f711323a782@opteya.com>
On Tue, Jun 07, 2022 at 06:34:46PM +0200, Yann Droneaud wrote:
> Hi,
>
> Le 06/06/2022 à 15:44, Adhemerval Zanella via Libc-alpha a écrit :
> > It was added on Linux 5.12 (2a1867219c7b27f928e2545782b86daaf9ad50bd)
> > to allow change the properties of a mount or a mount tree using file
> > descriptors which the new mount api is based on.
> >
> > Checked on x86_64-linux-gnu.
> > ---
> > NEWS | 6 ++--
> > sysdeps/unix/sysv/linux/Versions | 1 +
> > sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/arc/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/csky/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/i386/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 +
> > .../sysv/linux/m68k/coldfire/libc.abilist | 1 +
> > .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 +
> > .../sysv/linux/microblaze/be/libc.abilist | 1 +
> > .../sysv/linux/microblaze/le/libc.abilist | 1 +
> > .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 +
> > .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 +
> > .../sysv/linux/mips/mips64/n32/libc.abilist | 1 +
> > .../sysv/linux/mips/mips64/n64/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/or1k/libc.abilist | 1 +
> > .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 +
> > .../powerpc/powerpc32/nofpu/libc.abilist | 1 +
> > .../linux/powerpc/powerpc64/be/libc.abilist | 1 +
> > .../linux/powerpc/powerpc64/le/libc.abilist | 1 +
> > .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 +
> > .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 +
> > .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 +
> > .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 +
> > .../sysv/linux/sparc/sparc32/libc.abilist | 1 +
> > .../sysv/linux/sparc/sparc64/libc.abilist | 1 +
> > sysdeps/unix/sysv/linux/sys/mount.h | 22 ++++++++++++++
> > sysdeps/unix/sysv/linux/syscalls.list | 1 +
> > sysdeps/unix/sysv/linux/tst-mount.c | 30 +++++++++++++++++--
> > .../unix/sysv/linux/x86_64/64/libc.abilist | 1 +
> > .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 +
> > 38 files changed, 87 insertions(+), 6 deletions(-)
> >
> > diff --git a/NEWS b/NEWS
> > index de12657449..696de3962b 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -29,9 +29,9 @@ Major new features:
> > memory is carried out in the context of the caller, using the caller's
> > CPU affinity, and priority with CPU usage accounted to the caller.
> > -* On Linux, the fsopen, fsmount, move_mount, fsconfig, fspick, and open_tree
> > - have been added. It is a new mount API to allow more flexibility on mount
> > - operations, specially when used along namespaces.
> > +* On Linux, the fsopen, fsmount, move_mount, fsconfig, fspick, open_tree,
> > + and mount_setattr have been added. It is a new mount API to allow more
> > + flexibility on mount operations, specially when used along namespaces.
> > Deprecated and removed features, and other changes affecting compatibility:
> > diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> > index b70530ef40..65d2ceda2c 100644
> > --- a/sysdeps/unix/sysv/linux/Versions
> > +++ b/sysdeps/unix/sysv/linux/Versions
> > @@ -305,6 +305,7 @@ libc {
> > fsopen;
> > fspick;
> > move_mount;
> > + mount_setattr;
> > open_tree;
> > pidfd_open;
> > pidfd_getfd;
>
> > diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
> > index eb6705a091..4929d84027 100644
> > --- a/sysdeps/unix/sysv/linux/sys/mount.h
> > +++ b/sysdeps/unix/sysv/linux/sys/mount.h
> > @@ -23,6 +23,8 @@
> > #include <fcntl.h>
> > #include <features.h>
> > +#include <stdint.h>
> > +#include <stddef.h>
> > #include <sys/ioctl.h>
> > #define BLOCK_SIZE 1024
> > @@ -155,6 +157,17 @@ enum
> > #define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */
> > +/* For mount_setattr. */
> > +struct mount_attr
> > +{
> > + uint64_t attr_set;
> > + uint64_t attr_clr;
> > + uint64_t propagation;
> > + uint64_t userns_fd;
> > +};
> > +
> > +#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
> > +
> > /* move_mount flags. */
> > #define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
> > #define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
> > @@ -240,6 +253,15 @@ extern int fspick (int __dfd, const char *__path, unsigned int __flags)
> > extern int open_tree (int __dfd, const char *__filename, unsigned int __flags)
> > __THROW;
> > +/* Change the mount proprieties of the mount or an entire mount tree. If
> > + PATH is a relative pathname, then it is interpreted relative to the directory
> > + referred to by the file descriptor dirfd. Otherwise if DFD is the special
> > + value AT_FDCWD then PATH is interpreted relative to the current working
> > + directory of the calling process. */
> > +extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags,
> > + struct mount_attr *__uattr, size_t __usize)
> > + __THROW;
> > +
>
>
> I wonder why __uattr is not declared const struct mount_attr * ?
>
> Is it really expected that future mount_setattr() extensions to write back
> into the userspace structure ?
I don't think we can in principle rule this out. A const is a bit of a
scary commitment in this regard... I need to think about this a bit.
prev parent reply other threads:[~2022-06-07 18:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 13:44 [PATCH v5 0/8] linux: Add new syscalls Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 1/8] linux: Add fsopen Adhemerval Zanella
2022-06-17 21:28 ` Carlos O'Donell
2022-06-22 12:30 ` Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 2/8] linux: Add fsmount Adhemerval Zanella
2022-06-07 16:14 ` Yann Droneaud
2022-06-10 17:16 ` Adhemerval Zanella
2022-06-18 6:15 ` Carlos O'Donell
2022-06-22 12:41 ` Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 3/8] linux: Add move_mount Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 4/8] linux: Add fsconfig Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 5/8] linux: Add fspick Adhemerval Zanella
2022-06-07 16:19 ` Yann Droneaud
2022-06-10 17:19 ` Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 6/8] linux: Add open_tree Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 7/8] linux: Add tst-mount to check for Linux new mount API Adhemerval Zanella
2022-06-06 13:44 ` [PATCH v5 8/8] linux: Add mount_setattr Adhemerval Zanella
2022-06-07 16:27 ` Yann Droneaud
2022-06-10 17:21 ` Adhemerval Zanella
2022-06-07 16:34 ` Yann Droneaud
2022-06-07 18:10 ` Christian Brauner [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=20220607181032.s4rnqwxik7scuhzx@wittgenstein \
--to=brauner@kernel.org \
--cc=adhemerval.zanella@linaro.org \
--cc=carlos@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=ydroneaud@opteya.com \
/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).