linux-stable/fs/overlayfs
Miklos Szeredi be67725944 ovl: automatically enable redirect_dir on metacopy=on
commit d47748e5ae upstream.

Current behavior is to automatically disable metacopy if redirect_dir is
not enabled and proceed with the mount.

If "metacopy=on" mount option was given, then this behavior can confuse the
user: no mount failure, yet metacopy is disabled.

This patch makes metacopy=on imply redirect_dir=on.

The converse is also true: turning off full redirect with redirect_dir=
{off|follow|nofollow} will disable metacopy.

If both metacopy=on and redirect_dir={off|follow|nofollow} is specified,
then mount will fail, since there's no way to correctly resolve the
conflict.

Reported-by: Daniel Walsh <dwalsh@redhat.com>
Fixes: d5791044d2 ("ovl: Provide a mount option metacopy=on/off...")
Cc: <stable@vger.kernel.org> # v4.19
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:19:13 +01:00
..
copy_up.c vfs: swap names of {do,vfs}_clone_file_range() 2018-09-24 10:54:01 +02:00
dir.c ovl: check whiteout in ovl_create_over_whiteout() 2018-11-21 09:19:13 +01:00
export.c ovl: Modify ovl_lookup() and friends to lookup metacopy dentry 2018-07-20 09:56:09 +02:00
file.c vfs: swap names of {do,vfs}_clone_file_range() 2018-09-24 10:54:01 +02:00
inode.c ovl: make symbol 'ovl_aops' static 2018-09-25 20:41:23 +02:00
Kconfig ovl: Provide a mount option metacopy=on/off for metadata copyup 2018-07-20 09:56:06 +02:00
Makefile ovl: stack file ops 2018-07-18 15:44:41 +02:00
namei.c ovl: fix error handling in ovl_verify_set_fh() 2018-11-21 09:19:12 +01:00
overlayfs.h ovl: fix format of setxattr debug 2018-10-04 14:49:10 +02:00
ovl_entry.h ovl: Store lower data inode in ovl_inode 2018-07-20 09:56:11 +02:00
readdir.c ovl: fix wrong use of impure dir cache in ovl_iterate() 2018-07-17 16:04:34 +02:00
super.c ovl: automatically enable redirect_dir on metacopy=on 2018-11-21 09:19:13 +01:00
util.c ovl: fix memory leak on unlink of indexed file 2018-09-24 10:54:01 +02:00