diff options
author | Thomas Bertschinger <tahbertschinger@gmail.com> | 2024-05-26 13:08:20 -0600 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-06-23 12:57:13 -0400 |
commit | 2ae1eed33ea4715c07b3c0cf9958e11c58fd6911 (patch) | |
tree | 3b5a27288d1ce8feaa9a3249d79fedfe0467bf88 /fs/filesystems.c | |
parent | 87c521d09c085b66e9a45f60bd60c3bab380a46e (diff) |
bcachefs: don't expose "read_only" as a mount option
When "read_only" is exposed as a mount option, it is redundant with the
standard option "ro" and gives users multiple ways to specify that a
bcachefs filesystem should be mounted read-only. This presents the risk
of having inconsistent options specified.
This can be seen when remounting a read-only filesystem in read-write
mode, using mount(8) from util-linux. Because mount(8) parses the
existing mount options from `/proc/mounts` and applies them when
remounting, it can end up applying both "read_only" and "rw":
$ mount img -o ro /mnt
$ strace mount -o remount,rw /mnt
...
fsconfig(4, FSCONFIG_SET_FLAG, "read_only", NULL, 0) = 0
fsconfig(4, FSCONFIG_SET_FLAG, "rw", NULL, 0) = 0
...
Making "read_only" no longer a mount option means this edge case cannot
occur.
Fixes: 62719cf33c3a ("bcachefs: Fix nochanges/read_only interaction")
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/filesystems.c')
0 files changed, 0 insertions, 0 deletions