提交 9f99e50d 编写于 作者: A Amir Goldstein 提交者: Miklos Szeredi

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: a0c5ad30 ("ovl: relax same fs constraint for constant st_ino")
Cc: <stable@vger.kernel.org> #v4.15
Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
上级 3ec9b3fa
...@@ -118,13 +118,10 @@ int ovl_getattr(const struct path *path, struct kstat *stat, ...@@ -118,13 +118,10 @@ int ovl_getattr(const struct path *path, struct kstat *stat,
*/ */
if (ovl_test_flag(OVL_INDEX, d_inode(dentry)) || if (ovl_test_flag(OVL_INDEX, d_inode(dentry)) ||
(!ovl_verify_lower(dentry->d_sb) && (!ovl_verify_lower(dentry->d_sb) &&
(is_dir || lowerstat.nlink == 1))) (is_dir || lowerstat.nlink == 1))) {
stat->ino = lowerstat.ino; stat->ino = lowerstat.ino;
if (samefs)
WARN_ON_ONCE(stat->dev != lowerstat.dev);
else
stat->dev = ovl_get_pseudo_dev(dentry); stat->dev = ovl_get_pseudo_dev(dentry);
}
} }
if (samefs) { if (samefs) {
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册