lkml.org 
[lkml]   [2017]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/9] VFS: Introduce a mount context
On Tue, May 09, 2017 at 10:03:43AM +0200, Miklos Szeredi wrote:
> On Tue, May 9, 2017 at 12:57 AM, David Howells <dhowells@redhat.com> wrote:
> > Miklos Szeredi <mszeredi@redhat.com> wrote:
> >
> >> > + (3) Validate and pre-process the mount context.
> >>
> >> (3.5) Create super block
> >>
> >> I think this need to be triggered by something like a "commit" command
> >> from userspace. Basically this is where the options are atomically
> >> set on the new (create) or existing (reconfigure) superblock.
> >
> > Why do you need to expose this step to userspace? Assuming in the "new" case
> > you do, say:
> >
> > fd = fsopen("nfs");
> > write(fd, "s foo.bar:/bar", ...);
> > write(fd, "o intr", ...);
> > write(fd, "o fsc", ...);
> > ...
> > write(fd, "c", ...); /* commit operation to get a superblock */
> > fsmount(fd, AT_FDCWD, "/mnt"); /* mount the superblock we just got */
> >
> > Then the "commit" op is dissimilar to "mount -o remount" since remount may
> > alter the superblock parameters *and* the mountpoint parameters, but commit
> > can only affect the superblock.
>
> Forget remount, it's a historical remnant. We need fsreconfig(sb) and
> setmntattr(mnt). They are changing properties of different objects.

I agree and I'd like to highlight another issue we have with the
current mount(2). The problem is non-atomic work with more
propagation flags if you want to mount a filesystem. For example:

mount /dev/sda1 /A -o private,unbindable,ro

this is supported by mount(8), but it's implemented by three
independent mount(2) calls

- 1st mounts /dev/sda1 with MS_RDONLY
- 2nd sets MS_PRIVATE flag
- 3rd sets MS_UNBINDABLE flag.

it would be nice set all the VFS flags and then as atomic operation attach
the context to the tree.

Karel

--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com

\
 
 \ /
  Last update: 2017-05-10 21:21    [W:0.156 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site