linux/fs/overlayfs
Christian Brauner 1784fbc2ed ovl: port to new mount api
We recently ported util-linux to the new mount api. Now the mount(8)
tool will by default use the new mount api. While trying hard to fall
back to the old mount api gracefully there are still cases where we run
into issues that are difficult to handle nicely.

Now with mount(8) and libmount supporting the new mount api I expect an
increase in the number of bug reports and issues we're going to see with
filesystems that don't yet support the new mount api. So it's time we
rectify this.

When ovl_fill_super() fails before setting sb->s_root, we need to cleanup
sb->s_fs_info.  The logic is a bit convoluted but tl;dr: If sget_fc() has
succeeded fc->s_fs_info will have been transferred to sb->s_fs_info.
So by the time ->fill_super()/ovl_fill_super() is called fc->s_fs_info
is NULL consequently fs_context->free() won't call ovl_free_fs().

If we fail before sb->s_root() is set then ->put_super() won't be called
which would call ovl_free_fs(). IOW, if we fail in ->fill_super() before
sb->s_root we have to clean it up.

Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2023-06-19 14:02:01 +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 treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02: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: factor out ovl_parse_options() helper 2023-06-19 14:02:01 +03:00
ovl_entry.h ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00
readdir.c ovl: pass ovl_fs to xino helpers 2023-06-19 14:02:00 +03:00
super.c ovl: port to new mount api 2023-06-19 14:02:01 +03:00
util.c ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00