Re: [PATCH] Fix read-only superblock in case of subvol RO remount

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

 



On 22:09 10/02, Graham Cobb wrote:
> On 10/02/2022 22:03, Graham Cobb wrote:
> > On 10/02/2022 21:30, Goldwyn Rodrigues wrote:
> >> On 19:54 10/02, Graham Cobb wrote:
> >>> On 10/02/2022 16:51, Goldwyn Rodrigues wrote:
> >>>> If a read-write root mount is remounted as read-only, the subvolume
> >>>> is also set to read-only.
> >>>
> >>> Errrr... Isn't that exactly what I want?
> >>>
> >>> If I have a btrfs filesystem with hundreds of subvols, some of which may
> >>> be mounted into various places in my filesystem, I would expect that if
> >>> I remount the main mountpoint as RO, that all the subvols become RO as
> >>> well. I actually don't mind if the behaviour went further and remounting
> >>> ANY of the mount points as RO would make them all RO.
> >>>
> >>> My mental model is that mounting a subvol somewhere is rather like a
> >>> bind mount. And a bind mount goes RO if the underlying fs goes RO -
> >>> doesn't it?
> >>>
> >>
> >> If we want bind mount, we would use bind mount. subvolume mounts and bind
> >> mounts are different and should be treated as different features.
> > 
> > Yes that's a good point. However, I am still not convinced that this is
> > a change in behaviour that is obvious enough to justify the risk of
> > disruption to existing systems, admin scripts or system managers.
> > 
> >>
> >>> Or am I just confused about what this patch is discussing?
> >>
> >> Root can also be considered as a unique subvolume with a unique
> >> subvolume id and a unique name=/
> > 
> > But with an important special property that is different from all other
> > subvolumes: all other subvolumes are reachable from it.

Not quite. You can mount a subvolume directly without mounting the root:

mount -o subvol=<subvolname> <device> <mountpoint>

> 
> I should be a bit clearer. Imagine you create a filesystem and then
> create two subvolumes within it: a and a/b. You are suggesting that the
> result of remounting the top level of the filesystem as RO causes
> different effect on whether subvolume b goes RO depending on whether
> subvolume a has also been mounted somewhere?

I did not understand the question, too many "whether"s. :)

Check the test case.

If you mount a root subvolume (/) and a root's subvolume (/a or /a/b in your
case). You remount root as ro, the subvolume a or a/b mounts also become
read-only. 

On the other hand, if you mount a or a/b (RW) _after_ root is remounted RO,
the subvolume mounts are RW.


-- 
Goldwyn



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

  Powered by Linux