linux-stable/fs/overlayfs
Miklos Szeredi 2aff4534b6 ovl: check lower existence when removing
Currently ovl_lookup() checks existence of lower file even if there's a
non-directory on upper (which is always opaque).  This is done so that
remove can decide whether a whiteout is needed or not.

It would be better to defer this check to unlink, since most of the time
the gathered information about opaqueness will be unused.

This adds a helper ovl_lower_positive() that checks if there's anything on
the lower layer(s).

The following patches also introduce changes to how the "opaque" attribute
is updated on directories: this attribute is added when the directory is
creted or moved over a whiteout or object covering something on the lower
layer.  However following changes will allow the attribute to remain on the
directory after being moved, even if the new location doesn't cover
anything.  Because of this, we need to check lower layers even for opaque
directories, so that whiteout is only created when necessary.

This function will later be also used to decide about marking a directory
opaque, so deal with negative dentries as well.  When dealing with
negative, it's enough to check for being a whiteout

If the dentry is positive but not upper then it also obviously needs
whiteout/opaque.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2016-12-16 11:02:55 +01:00
..
copy_up.c ovl: use vfs_clone_file_range() for copy up if possible 2016-12-16 11:02:54 +01:00
dir.c ovl: check lower existence when removing 2016-12-16 11:02:55 +01:00
inode.c ovl: treat special files like a regular fs 2016-12-16 11:02:55 +01:00
Kconfig ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
Makefile ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
overlayfs.h ovl: check lower existence when removing 2016-12-16 11:02:55 +01:00
readdir.c ovl: proper cleanup of workdir 2016-09-01 11:11:59 +02:00
super.c ovl: check lower existence when removing 2016-12-16 11:02:55 +01:00