kernel_optimize_test/fs/overlayfs
Miklos Szeredi 27c1936af5 ovl: allow upperdir inside lowerdir
commit 708fa01597fa002599756bf56a96d0de1677375c upstream.

Commit 146d62e5a5 ("ovl: detect overlapping layers") made sure we don't
have overlapping layers, but it also broke the arguably valid use case of

 mount -olowerdir=/,upperdir=/subdir,..

where upperdir overlaps lowerdir on the same filesystem.  This has been
causing regressions.

Revert the check, but only for the specific case where upperdir and/or
workdir are subdirectories of lowerdir.  Any other overlap (e.g. lowerdir
is subdirectory of upperdir, etc) case is crazy, so leave the check in
place for those.

Overlaps are detected at lookup time too, so reverting the mount time check
should be safe.

Fixes: 146d62e5a5 ("ovl: detect overlapping layers")
Cc: <stable@vger.kernel.org> # v5.2
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-07 11:04:33 +02:00
..
copy_up.c ovl: skip getxattr of security labels 2021-02-17 11:02:22 +01:00
dir.c ovl: fix dentry leak in ovl_get_redirect 2021-02-10 09:29:15 +01:00
export.c ovl: pass ovl_fs down to functions accessing private xattrs 2020-09-02 10:58:49 +02:00
file.c ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00
inode.c ovl: perform vfs_getxattr() with mounter creds 2021-02-17 11:02:22 +01:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: fix leaked dentry 2021-05-07 11:04:32 +02:00
overlayfs.h ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00
ovl_entry.h ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00
readdir.c ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00
super.c ovl: allow upperdir inside lowerdir 2021-05-07 11:04:33 +02:00
util.c ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00