summaryrefslogtreecommitdiff
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-04-11 20:09:29 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2018-04-12 13:04:49 +0300
commit9f99e50d460ac7fd5f6c9b97aad0088c28c8656d (patch)
treeba5dc1eb1b4dba7e11e3d26b4e4bfa8603908e9f /fs/overlayfs
parent3ec9b3fafcaf441cc4d46b9742cd6ec0c79f8df0 (diff)
downloadlinux-9f99e50d460ac7fd5f6c9b97aad0088c28c8656d.tar.xz
ovl: set lower layer st_dev only if setting lower st_ino
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>
Diffstat (limited to 'fs/overlayfs')
-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 4689716f23d8..1d75b2e96c96 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -118,13 +118,10 @@ int ovl_getattr(const struct path *path, struct kstat *stat,
*/
if (ovl_test_flag(OVL_INDEX, d_inode(dentry)) ||
(!ovl_verify_lower(dentry->d_sb) &&
- (is_dir || lowerstat.nlink == 1)))
+ (is_dir || lowerstat.nlink == 1))) {
stat->ino = lowerstat.ino;
-
- if (samefs)
- WARN_ON_ONCE(stat->dev != lowerstat.dev);
- else
stat->dev = ovl_get_pseudo_dev(dentry);
+ }
}
if (samefs) {
/*