Feature bug with the new mount API: no way of doing read only bind mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux