summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-04-11 20:09:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-19 08:55:13 +0200
commitc4f45cf301e6fc024ef5eb3eca234c659d751cb8 (patch)
treeaad96c26702fb581abdab8c35f43d003d9576678
parent9def916c750d9f87527931b13e766f381a3a3811 (diff)
downloadlinux-stable-c4f45cf301e6fc024ef5eb3eca234c659d751cb8.tar.gz
linux-stable-c4f45cf301e6fc024ef5eb3eca234c659d751cb8.tar.bz2
linux-stable-c4f45cf301e6fc024ef5eb3eca234c659d751cb8.zip
ovl: set lower layer st_dev only if setting lower st_ino
commit 9f99e50d460ac7fd5f6c9b97aad0088c28c8656d upstream. For broken hardlinks, we do not return lower st_ino, so we should also not return lower pseudo st_dev. Fixes: a0c5ad307ac0 ("ovl: relax same fs constraint for constant st_ino") Cc: <stable@vger.kernel.org> #v4.15 Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/overlayfs/inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 94d2f8a8b779..0dbbfedef54c 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -110,13 +110,10 @@ int ovl_getattr(const struct path *path, struct kstat *stat,
* that the upper hardlink is not broken.
*/
if (is_dir || lowerstat.nlink == 1 ||
- ovl_test_flag(OVL_INDEX, d_inode(dentry)))
+ ovl_test_flag(OVL_INDEX, d_inode(dentry))) {
stat->ino = lowerstat.ino;
-
- if (samefs)
- WARN_ON_ONCE(stat->dev != lowerstat.dev);
- else
stat->dev = ovl_get_pseudo_dev(dentry);
+ }
}
if (samefs) {
/*