linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: David Howells <dhowells@redhat.com>,
	Miklos Szeredi <mszeredi@redhat.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Petr Vorel <pvorel@suse.cz>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>
Subject: Setting mount propagation type in new mount API
Date: Fri, 15 May 2020 13:40:14 +0200	[thread overview]
Message-ID: <CAKgNAkioH1z-pVimHziWP=ZtyBgCOwoC7ekWGFwzaZ1FPYg-tA@mail.gmail.com> (raw)

Hello David, Miklos,

I've been looking at the new mount API (fsopen(), fsconfig(),
fsmount(), move_mount(), etc.) and among the details that remain
mysterious to me is this: how does one set the propagation type
(private/shared/slave/unbindable) of a new mount and change the
propagation type of an existing mount?

I've looked at the kernel source for a bit, and did not see how this
is possible.

The draft manual pages sent out a few months ago provide little clue,
with the only hint being in the draft fsopen(2) page, which says of
fsmount():

       fsmount()  takes the file descriptor returned by fsopen() and cre‐
       ates a mount object for the filesystem root specified there.   The
       attributes of the mount object are set from the mount_attrs param‐
       eter.  The attributes specify the propagation and  mount  restric‐
       tions to be applied to accesses through this mount.

However, that text appears *not* to be true. The 'mount_attrs'
argument of fsmount() does not seem to permit specification of
propagation type, since in the kernel there is this check:

        if (attr_flags & ~(MOUNT_ATTR_RDONLY |
                           MOUNT_ATTR_NOSUID |
                           MOUNT_ATTR_NODEV |
                           MOUNT_ATTR_NOEXEC |
                           MOUNT_ATTR__ATIME |
                           MOUNT_ATTR_NODIRATIME))
                return -EINVAL;

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

             reply	other threads:[~2020-05-15 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 11:40 Michael Kerrisk (man-pages) [this message]
2020-05-15 13:04 ` Setting mount propagation type in new mount API Miklos Szeredi
2020-05-15 13:18   ` Miklos Szeredi
2020-05-18 14:30 ` David Howells
2020-05-18 14:42   ` 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='CAKgNAkioH1z-pVimHziWP=ZtyBgCOwoC7ekWGFwzaZ1FPYg-tA@mail.gmail.com' \
    --to=mtk.manpages@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=pvorel@suse.cz \
    /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 NNTP newsgroup(s).