linux/fs/overlayfs
Miklos Szeredi d377c5eb54 ovl: don't remove non-empty opaque directory
When removing an opaque directory we can't just call rmdir() to check for
emptiness, because the directory will need to be replaced with a whiteout.
The replacement is done with RENAME_EXCHANGE, which doesn't check
emptiness.

Solution is just to check emptiness by reading the directory.  In the
future we could add a new rename flag to check for emptiness even for
RENAME_EXCHANGE to optimize this case.

Reported-by: Vincent Batts <vbatts@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Jordi Pujol Palomer <jordipujolp@gmail.com>
Fixes: 263b4a0fee ("ovl: dont replace opaque dir")
Cc: <stable@vger.kernel.org> # v4.0+
2015-05-14 10:04:44 +02:00
..
copy_up.c ovl: Cleanup redundant blank lines 2014-12-13 00:59:52 +01:00
dir.c ovl: don't remove non-empty opaque directory 2015-05-14 10:04:44 +02:00
inode.c ovl: Use macros to present ovl_xattr 2014-12-13 00:59:52 +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: Use macros to present ovl_xattr 2014-12-13 00:59:52 +01:00
readdir.c Merge branch 'overlayfs-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs into for-next 2015-02-20 04:58:52 -05:00
super.c ovl: upper fs should not be R/O 2015-03-18 10:29:48 +01:00