Commit Graph

11 Commits

Author SHA1 Message Date
Eryu Guan a1c4e17d4a overlay: remove dir which contains whiteout from lower dir
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>
2016-07-01 11:17:08 +08:00
Eryu Guan 4ae7290adc overlay: dentry leak for default_permissions mount option
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>
2016-07-01 11:17:08 +08:00
Eryu Guan 6842811457 overlay: create new file over whiteout
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>
2016-06-23 20:18:32 +08:00
Eryu Guan b3b54d0d9e overlay: getcwd() after a failed rmdir
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>
2016-06-23 20:18:29 +08:00
Eryu Guan 4fb7f2da7c overlay: test visible whiteout issue after rename
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>
2016-06-23 20:18:07 +08:00
Xiong Zhou 8b8cdb084b overlay: test memleak in copy-up error handling path
This memleak leads to panic when unmount the underlying fs.
Kernel commit ab79efab0 fixed this issue.

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:33:47 +08:00
Xiong Zhou bf46f47cd8 overlay: test copy up by changing mode bits
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>
2016-05-09 10:56:29 +10:00
Xiong Zhou a175556a26 overlay: test basic whiteout
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>
2016-05-09 10:55:44 +10:00
Filipe Manana b90938ec1d overlay/001: change supported fs from generic to overlay
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>
2016-03-23 17:39:11 +11:00
Filipe Manana 32253c7b40 overlayfs: test fsync on merged directory
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>
2016-03-23 17:39:11 +11:00
Eryu Guan 115b41cd80 overlay: test copy up files from lower dir
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>
2016-02-08 09:27:14 +11:00