linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Feature bug with the new mount API: no way of doing read only bind mounts
@ 2019-11-21  0:11 James Bottomley
  2019-11-21  8:10 ` David Howells
  0 siblings, 1 reply; 13+ messages in thread
From: James Bottomley @ 2019-11-21  0:11 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: dhowells, Al Viro, Miklos Szeredi

My understanding is the new mount API will eventually replace the
current mount API, so it needs to be feature for feature compatible
before that happens.  I was looking to use the read only bind mount as
a template for reimplementing shiftfs when I discovered that you can't
actually create a read only bind mount with the new API.  The problem
is that fspick() will only reconfigure the underlying superblock, which
you don't want because you only want the bound subtree to become read
only and open_tree()/move_mount() doesn't give you any facility to add
or change options on the bind.

The way it works with the current API is that you create a bind mount
with MS_BIND and then remount it with MS_BIND|MS_REMOUNT|MS_RDONLY
which makes the subtree go read only.  It looks like the nearest way of
getting this to work with the new API would be to add an additional
fspick() flag, say FSPICK_BIND, that tells it to operate on the subtree
not the superblock and then pass this down to fsconfig() so it will
accept the "ro" and "rw" flags and the reconfigure command and nothing
else (although I'd like it to accept additional flags on down the road
for the shiftfs rewrite).

There are some caveats, in that fspick/fsconfig seem to be fairly
adamantly coded to work with the superblock, so the subtree handling
will have to be special cased, but if everyone's happy with that, I can
code up something.

Regards,

James


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-11-27 21:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21  0:11 Feature bug with the new mount API: no way of doing read only bind mounts James Bottomley
2019-11-21  8:10 ` David Howells
2019-11-21 14:54   ` Christian Brauner
2019-11-21 15:00   ` James Bottomley
2019-11-21 15:04   ` David Howells
2019-11-21 16:15   ` James Bottomley
2019-11-27 20:32     ` James Bottomley
2019-11-27 20:33       ` [RFC 1/6] logger: add a limited buffer logging facility James Bottomley
2019-11-27 20:34       ` [RFC 2/6] configfd: add generic file descriptor based configuration parser James Bottomley
2019-11-27 20:35       ` [RFC 3/6] configfd: syscall: wire up configfd syscalls James Bottomley
2019-11-27 20:36       ` [RFC 4/6] fs: implement fsconfig via configfd James Bottomley
2019-11-27 20:37       ` [RFC 5/6] fs: expose internal interfaces open_detached_copy and do_reconfigure_mount James Bottomley
2019-11-27 20:38       ` [RFC 6/6] fs: bind: add configfs type for bind mounts James Bottomley

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