linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * Re: User-visible context-mount API
           [not found] <28167.1516032442@warthog.procyon.org.uk>
           [not found] ` <28167.1516032442-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
    @ 2018-01-16 10:10 ` David Howells
      2018-01-16 10:35   ` Miklos Szeredi
                         ` (2 more replies)
           [not found] ` <CAOssrKdgudK7kKbhQBAnV9EwzHBq=4+9M26JGfmhNDGrGXmnFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
      2 siblings, 3 replies; 13+ messages in thread
    From: David Howells @ 2018-01-16 10:10 UTC (permalink / raw)
      To: Miklos Szeredi
      Cc: dhowells, viro, Jeff Layton, Eric W. Biederman, linux-fsdevel,
    	Linux API
    
    Miklos Szeredi <mszeredi@redhat.com> wrote:
    
    > >  (6) Adjust a mountpoint's topology flags:
    > >
    > >         mount_set_topology(int dfd, const char *path,
    > >                            unsigned int topology_flags);
    > >
    > >  (7) Reconfigure a mountpoint:
    > >
    > >         mount_reconfigure(int dfd, const char *path,
    > >                           unsigned int mount_flags);
    > 
    > 
    > What's the fundamental  difference between topology flags and other
    > flags?  Why two syscalls?
    
    Inside the kernel the MS_* flags appear to belong to a number of fundamentally
    different classes:
    
     (1) Things like MS_SILENT and MS_REMOUNT which affect the behaviour of the
         mount process, but aren't persistent beyond that.
    
     (2) Inter-namespace topology management, controlling how mounts are shared
         and duplicated between namespaces.
    
     (3) Restrictions on accesses through a particular mountpoint, eg. MS_NODEV,
         MS_NOEXEC.
    
     (4) Instructions to a filesystem on how a superblock is to behave.
    
    I think the classes are fundamentally different - and we've already separated
    (4) from the others inside the kernel.  However, I've no great objection to
    keeping (2) and (3) together in the same mask.  It just sounds cleaner to
    separate them.  Do we foresee adding any extra flags to these classes?
    
    > Also I think we need a "mask" argument telling the kernel which flags
    > need to be changed.
    
    Sounds reasonable.
    
    > >  (8) Change R/O protection on a mountpoint:
    > >
    > >         mount_protect(int dfd, const char *path,
    > >                       bool read_only);
    > >
    > >      This involves changing the R/O protection on the superblock also, but
    > >      might be mergeable with mount_reconfigure().
    > 
    > Methinks this should be merged with mount_reconfigure(), and if
    > superblock state needs to be changed, than that should be done with
    > the "remount" procedure below.
    
    Maybe - the problem is that it's harder to manage if you've got multiple
    mounts attached to a single superblock as you can only change the superblock
    state if all the mounts are R/O.
    
    > >         write(mfd, "o bind=1"); // Set MS_BIND
    > 
    > What does MS_BIND mean here?
    
    Sorry, bad example; MS_BIND wouldn't be allowed there.  Consider the following
    instead:
    
         write(mfd, "o nodev=1"); // Set 'MS_NODEV'
    
    > >         write(mfd, "o nosuid=1"); // Set MS_NOSUID
    > >
    > >         mount_create(mfd, AT_FDCWD, "/mnt/a", sbfd);
    > 
    > Yeah, more flexible, but also more complicated, with mount_create()
    > now taking 3 file descriptors, ugh...
    
    Yeah, I know:-/ ... but there are more parameters that I can foresee adding
    (such as [ug]id mapping tables), and a syscall just doesn't have enough
    argument space.  Also, I think that we need to set all the parameters on a
    mountpoint at the time of creation and that doing this retroactively isn't a
    good idea, since it's live as soon as it's created.
    
    David
    
    ^ permalink raw reply	[flat|nested] 13+ messages in thread
  • [parent not found: <CAOssrKdgudK7kKbhQBAnV9EwzHBq=4+9M26JGfmhNDGrGXmnFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]

  • end of thread, other threads:[~2018-01-19  6:32 UTC | newest]
    
    Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <28167.1516032442@warthog.procyon.org.uk>
         [not found] ` <28167.1516032442-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
    2018-01-16  9:01   ` User-visible context-mount API Miklos Szeredi
    2018-01-16 10:10 ` David Howells
    2018-01-16 10:35   ` Miklos Szeredi
         [not found]   ` <CAOssrKc46bf=yme=zSubYF6t-TGfxEpCaKMQ6GVp30-vuaXWLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2018-01-16 14:18     ` David Howells
         [not found]   ` <22576.1516097412-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
    2018-01-17 10:43     ` Karel Zak
         [not found] ` <CAOssrKdgudK7kKbhQBAnV9EwzHBq=4+9M26JGfmhNDGrGXmnFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2018-01-16 15:40   ` David Howells
         [not found]     ` <1643.1516117204-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
    2018-01-16 16:41       ` Miklos Szeredi
         [not found]         ` <CAOssrKdn-ZhOB9V28uL-JK9zgNGJzF4cFBeyoqLLj4pADqNFVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2018-01-17  4:17           ` Al Viro
    2018-01-17  9:53             ` Miklos Szeredi
         [not found]               ` <CAOssrKfN_ZT5yJC1mxkhUf6FG=_eMD4nzQtETfu_4X3vOf1kHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2018-01-17 11:06                 ` Karel Zak
         [not found]                   ` <20180117110633.zneqvnjzgxkv4yc2-xkT7n84Rsxv/9pzu0YdTqQ@public.gmane.org>
    2018-01-18  9:48                     ` Miklos Szeredi
    2018-01-19  2:27                     ` Al Viro
    2018-01-19  6:32                 ` Al Viro
    

    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).