diff options
author | Amir Goldstein <amir73il@gmail.com> | 2019-11-17 18:43:44 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-12-10 18:00:55 +0300 |
commit | 9c6d8f13e9da10a26ad7f0a020ef86e8ef142835 (patch) | |
tree | db5a644e905250ecdc801a262a8cf6ef27366995 /fs/overlayfs/dir.c | |
parent | ec7bbb53d339250df7d4b042ff93c468535c0a90 (diff) | |
download | linux-9c6d8f13e9da10a26ad7f0a020ef86e8ef142835.tar.xz |
ovl: fix corner case of non-unique st_dev;st_ino
On non-samefs overlay without xino, non pure upper inodes should use a
pseudo_dev assigned to each unique lower fs and pure upper inodes use the
real upper st_dev.
It is fine for an overlay pure upper inode to use the same st_dev;st_ino
values as the real upper inode, because the content of those two different
filesystem objects is always the same.
In this case, however:
- two filesystems, A and B
- upper layer is on A
- lower layer 1 is also on A
- lower layer 2 is on B
Non pure upper overlay inode, whose origin is in layer 1 will have the same
st_dev;st_ino values as the real lower inode. This may result with a false
positive results of 'diff' between the real lower and copied up overlay
inode.
Fix this by using the upper st_dev;st_ino values in this case. This breaks
the property of constant st_dev;st_ino across copy up of this case. This
breakage will be fixed by a later patch.
Fixes: 5148626b806a ("ovl: allocate anon bdev per unique lower fs")
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/dir.c')
0 files changed, 0 insertions, 0 deletions