linux-stable/fs/overlayfs
Christian Brauner ceecc2d87f ovl: reserve ability to reconfigure mount options with new mount api
Using the old mount api to remount an overlayfs superblock via
mount(MS_REMOUNT) all mount options will be silently ignored. For
example, if you create an overlayfs mount:

        mount -t overlay overlay -o lowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work /mnt/merged

and then issue a remount via:

        # force mount(8) to use mount(2)
        export LIBMOUNT_FORCE_MOUNT2=always
        mount -t overlay overlay -o remount,WOOTWOOT,lowerdir=/DOESNT-EXIST /mnt/merged

with completely nonsensical mount options whatsoever it will succeed
nonetheless. This prevents us from every changing any mount options we
might introduce in the future that could reasonably be changed during a
remount.

We don't need to carry this issue into the new mount api port. Similar
to FUSE we can use the fs_context::oldapi member to figure out that this
is a request coming through the legacy mount api. If we detect it we
continue silently ignoring all mount options.

But for the new mount api we simply report that mount options cannot
currently be changed. This will allow us to potentially alter mount
properties for new or even old properties. It any case, silently
ignoring everything is not something new apis should do.

Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2023-06-20 18:28:07 +03:00
..
copy_up.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
dir.c ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00
export.c ovl: deduplicate lowerpath and lowerstack[] 2023-06-19 14:01:13 +03:00
file.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
inode.c ovl: pass ovl_fs to xino helpers 2023-06-19 14:02:00 +03:00
Kconfig ovl: Kconfig: Fix spelling mistake "undelying" -> "underlying" 2022-12-08 10:49:46 +01:00
Makefile ovl: modify layer parameter parsing 2023-06-20 14:10:40 +03:00
namei.c ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00
overlayfs.h ovl: modify layer parameter parsing 2023-06-20 14:10:40 +03:00
ovl_entry.h ovl: modify layer parameter parsing 2023-06-20 14:10:40 +03:00
params.c ovl: modify layer parameter parsing 2023-06-20 14:10:40 +03:00
readdir.c ovl: pass ovl_fs to xino helpers 2023-06-19 14:02:00 +03:00
super.c ovl: reserve ability to reconfigure mount options with new mount api 2023-06-20 18:28:07 +03:00
util.c ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00