Test the removal of a dir which contains whiteout from lower dir,
which could crash the kernel.
The following kernel commit fixed this issue
84889d4 ovl: check dentry positiveness in ovl_cleanup_whiteouts()
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
overlayfs was leaking dentry on non-directories when using the
'default_permissions' mount option, which resulted in "BUG Dentry
still in use".
The following kernel commit fixed it:
ovl: fix dentry leak for default_permissions
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Create file/dir over whiteout by another user, uid/gid of the
file/dir should be current fsuid/fsgid, not the mounter's.
This upstream kernel patch fixed the issue
d0e13f5 ovl: fix uid/gid when creating over whiteout
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test getcwd() failure after unsuccessful rmdir, the getcwd() call
should return the correct path.
Upstream commit ce9113bbcbf4 ("ovl: fix getcwd() failure after
unsuccessful rmdir") fixed this issue.
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test visible whiteout issue after renaming file from lowerdir to a
dir in upperdir.
Upstream commit 45d117389696 ("ovl: ignore lower entries when
checking purity of non-directory entries") fixed the issue
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Changing file attr in overlayfs triggers copy up.
Test this by changing mode bits then check both mode
bits and copy up results.
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Once a while, overlayfs whiteout can be visible if upper fs
does not support d_type(ftype/filetype). Test as a sanity
check on whiteout of regular files, links, dirs, devices
and pipes.
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The supported fs was set to generic by mistake, so fix it by setting it
to the proper type 'overlay'.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test that calling fsync against a file using the merged directory does
not result in a crash nor fails unexpectedly.
This is motivated by a change in overlayfs that resulted in a crash
(invalid memory access) when the lower or upper directory belonged to
a btrfs file system. The overlayfs change came in commit 4bacc9c9234
(overlayfs: Make f_path always point to the overlay and f_inode to the
underlay). At the moment there are two patches in the linux-fsdevel
and linux-btrfs mailing lists to fix this problem:
* vfs: add file_dentry()
* Btrfs: fix crash/invalid memory access on fsync when using overlayfs
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test copy up files from lower dir that are <, =, > 4G in size.
Kernel commit 0480334fa604 ("ovl: use O_LARGEFILE in ovl_copy_up()")
fixed bug when copying up large file(>4G) from lower dir.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>