btrfs: handle the ro->rw transition for mounting different subvolumes
This is a special case that we've carried around since 0723a047 ("btrfs: allow mounting btrfs subvolumes with different ro/rw options") where we'll under the covers flip the file system to RW if you're mixing and matching ro/rw options with different subvol mounts. The first mount is what the super gets setup as, so we'd handle this by remount the super as rw under the covers to facilitate this behavior. With the new mount API we can't really allow this, because user space has the ability to specify the super block settings, and the mount settings. So if the user explicitly sets the super block as read only, and then tried to mount a rw mount with the super block we'll reject this. However the old API was less descriptive and thus we allowed this kind of behavior. This patch preserves this behavior for the old API calls. This is inspired by Christians work [1], and includes his comment in btrfs_get_tree_super() explaining the history and how it all works in the old and new APIs. Link: https://lore.kernel.org/all/20230626-fs-btrfs-mount-api-v1-2-045e9735a00b@kernel.org/ Reviewed-by:Christian Brauner <brauner@kernel.org> Reviewed-by:
Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by:
Josef Bacik <josef@toxicpanda.com> Reviewed-by:
David Sterba <dsterba@suse.com> Signed-off-by:
David Sterba <dsterba@suse.com>
Loading
-
mentioned in commit 3c36a72c
-
mentioned in commit c1954d04
-
mentioned in commit 3c36a72c
-
mentioned in commit ca25b33c
-
mentioned in commit 3a0c7986
-
mentioned in commit 2a604407
-
mentioned in commit b5554c54
-
mentioned in commit cda7163d
-
mentioned in commit 951a3f59
-
mentioned in commit 134be143
-
mentioned in commit 653b704e
Please register or sign in to comment