kernel_optimize_test/fs/overlayfs
Amir Goldstein 5b6c9053fb ovl: persistent inode numbers for upper hardlinks
An upper type non directory dentry that is a copy up target
should have a reference to its lower copy up origin.

There are three ways for an upper type dentry to be instantiated:
1. A lower type dentry that is being copied up
2. An entry that is found in upper dir by ovl_lookup()
3. A negative dentry is hardlinked to an upper type dentry

In the first case, the lower reference is set before copy up.
In the second case, the lower reference is found by ovl_lookup().
In the last case of hardlinked upper dentry, it is not easy to
update the lower reference of the negative dentry.  Instead,
drop the newly hardlinked negative dentry from dcache and let
the next access call ovl_lookup() to find its lower reference.

This makes sure that the inode number reported by stat(2) after
the hardlink is created is the same inode number that will be
reported by stat(2) after mount cycle, which is the inode number
of the lower copy up origin of the hardlink source.

NOTE that this does not fix breaking of lower hardlinks on copy
up, but only fixes the case of lower nlink == 1, whose upper copy
up inode is hardlinked in upper dir.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2017-05-05 11:38:58 +02:00
..
copy_up.c ovl: store file handle of lower inode on copy up 2017-05-05 11:38:58 +02:00
dir.c ovl: persistent inode numbers for upper hardlinks 2017-05-05 11:38:58 +02:00
inode.c ovl: merge getattr for dir and nondir 2017-05-05 11:38:58 +02:00
Kconfig ovl: allow redirect_dir to default to "on" 2016-12-16 11:02:57 +01:00
Makefile ovl: split super.c 2016-12-16 11:02:56 +01:00
namei.c ovl: lookup non-dir copy-up-origin by file handle 2017-05-05 11:38:58 +02:00
overlayfs.h ovl: merge getattr for dir and nondir 2017-05-05 11:38:58 +02:00
ovl_entry.h ovl: check if all layers are on the same fs 2017-05-05 11:38:57 +02:00
readdir.c ovl: proper cleanup of workdir 2016-09-01 11:11:59 +02:00
super.c ovl: check if all layers are on the same fs 2017-05-05 11:38:57 +02:00
util.c ovl: set the ORIGIN type flag 2017-05-05 11:38:58 +02:00