ovl: relax same fs constraint for constant st_ino
authorAmir Goldstein <amir73il@gmail.com>
Tue, 31 Oct 2017 22:45:40 +0000 (00:45 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 9 Nov 2017 09:23:27 +0000 (10:23 +0100)
commita0c5ad307ac09fa1c73b57bfd94f4c3fd6ba92d8
treefb61cccbb086c0ae1f3a4e77cd8ccfdc102abdf5
parentba1e563cdc6b07f2d5d9eee854fb3cdf3596470f
ovl: relax same fs constraint for constant st_ino

For the case of all layers not on the same fs, return the copy up origin
inode st_dev/st_ino for non-dir from stat(2).

This guaranties constant st_dev/st_ino for non-dir across copy up.
Like the same fs case, st_ino of non-dir is also persistent.

If the st_dev/st_ino for copied up object would have been the same as
that of the real underlying lower file, running diff on underlying lower
file and overlay copied up file would result in diff reporting that the
two files are equal when in fact, they may have different content.

Therefore, unlike the same fs case, st_dev is not persistent because it
uses the unique anonymous bdev allocated for the lower layer.

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