]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
overlay: Test consistent d_ino feature for non-samefs setup
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Thu, 12 Oct 2017 13:34:32 +0000 (19:04 +0530)
committerEryu Guan <eguan@redhat.com>
Fri, 13 Oct 2017 04:12:12 +0000 (12:12 +0800)
commit2acbc4f07ab2667f98d189cea258cf63a79a866d
treeaf08ff9799bf05733cbb06000fe48328eb5eacee
parent228aee780f13804a58915d18623b62103d1e920e
overlay: Test consistent d_ino feature for non-samefs setup

This commit adds a test to verify consistent d_ino feature when
the overlayfs instance is composed of two different underlying
filesystem instances.

For example,
$ mount -t xfs /dev/loop0 /mnt/test
$ mount -t xfs /dev/loop1 /mnt/scratch
$ mkdir /mnt/scratch/upper
$ mkdir /mnt/scratch/work
$ mount -t overlay overlay -o lowerdir=/mnt/test \
        -o upperdir=/mnt/scratch/upper \
-o workdir=/mnt/scratch/work /mnt/merge

The goal of this test is to verify that the inode numbers returned by
readdir(3) (i.e. dirent->d_ino) are consistent with inode numbers
returned by stat(2) (i.e. stat->st_ino) in all the below listed cases,
- Parent's (i.e. "..") d_ino must always be calculated because a
  pure dir can be residing inside a merged dir.
- d_ino for "." must always be calculated because the present
  directory can have a copy-up origin.
- Verify d_ino of '.' and '..' before and after dir becomes impure.
  While at it also verify if trusted.overlay.impure xattr is
  set/reset appropriately and invalidation of readdir cache.
- Verify copied up file's (inside a impure dir) d_ino.
- Verify invalidation of readdir cache.
- Verify d_ino values corresponding to "." and ".." entries of a
  pure lower dir.
- Verify d_ino of ".." entry of a merged dir.
- Verify pure lower residing in dir which has another lower layer

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/overlay/041 [new file with mode: 0755]
tests/overlay/041.out [new file with mode: 0644]
tests/overlay/group