diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-04-11 20:09:29 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-04-12 12:04:49 +0200 |
commit | 9f99e50d460ac7fd5f6c9b97aad0088c28c8656d (patch) | |
tree | ba5dc1eb1b4dba7e11e3d26b4e4bfa8603908e9f /fs/overlayfs | |
parent | 3ec9b3fafcaf441cc4d46b9742cd6ec0c79f8df0 (diff) |
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.c | 7 |
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) { /* |