[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170510124128.jpjhbn5oxqtczquh@ws.net.home>
Date: Wed, 10 May 2017 14:41:28 +0200
From: Karel Zak <kzak@...hat.com>
To: Miklos Szeredi <mszeredi@...hat.com>
Cc: David Howells <dhowells@...hat.com>,
viro <viro@...iv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-nfs@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [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@...hat.com> wrote:
> > Miklos Szeredi <mszeredi@...hat.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@...hat.com>
http://karelzak.blogspot.com
Powered by blists - more mailing lists