]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ovl: constant st_ino/st_dev across copy up
authorAmir Goldstein <amir73il@gmail.com>
Sun, 23 Apr 2017 21:25:49 +0000 (00:25 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 5 May 2017 09:38:58 +0000 (11:38 +0200)
commit72b608f08528458334218a809d66ea94d924c378
tree759ba4c56e36ceaa58e23d5e63bf461f20c868a3
parentb7a807dc2010334e62e0afd89d6f7a8913eb14ff
ovl: constant st_ino/st_dev across copy up

When all layers are on the same underlying filesystem, let stat(2) return
st_dev/st_ino values of the copy up origin inode if it is known.

This results in constant st_ino/st_dev representation of files in an
overlay mount before and after copy up.

When the underlying filesystem support NFS exportfs, the result is also
persistent st_ino/st_dev representation before and after mount cycle.

Lower hardlinks are broken on copy up to different upper files, so we
cannot use the lower origin st_ino for those different files, even for the
same fs case.

When all overlay layers are on the same fs, use overlay st_dev for non-dirs
to get the correct result from du -x.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c