From: David Howells Subject: Re: User-visible context-mount API Date: Tue, 16 Jan 2018 14:18:22 +0000 Message-ID: <30249.1516112302@warthog.procyon.org.uk> References: <28167.1516032442@warthog.procyon.org.uk> <22576.1516097412@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: Content-ID: <30248.1516112302.1-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Miklos Szeredi Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, viro , Jeff Layton , "Eric W. Biederman" , linux-fsdevel , Linux API List-Id: linux-api@vger.kernel.org Miklos Szeredi wrote: > > 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. > > Not true: > > [root@veci ~]# cat /proc/self/mountinfo | grep 46 > 212 78 0:46 / /tmp/1 rw,relatime shared:153 - tmpfs tmpfs rw,seclabel > 219 78 0:46 / /tmp/2 rw,relatime shared:153 - tmpfs tmpfs rw,seclabel > [root@veci ~]# mount -oremount,ro /tmp/1 > [root@veci ~]# cat /proc/self/mountinfo | grep 46 > 212 78 0:46 / /tmp/1 ro,relatime shared:153 - tmpfs tmpfs ro,seclabel > 219 78 0:46 / /tmp/2 rw,relatime shared:153 - tmpfs tmpfs ro,seclabel > [root@veci ~]# mount -oremount,bind,rw /tmp/1 > [root@veci ~]# cat /proc/self/mountinfo | grep 46 > 212 78 0:46 / /tmp/1 rw,relatime shared:153 - tmpfs tmpfs ro,seclabel > 219 78 0:46 / /tmp/2 rw,relatime shared:153 - tmpfs tmpfs ro,seclabel > [root@veci ~]# > > R/O flag on mount and on superblock can be changed independently. Ah... I misread the code. I was looking at the check that there are no writers on a mount. David