mirror of https://gitee.com/openkylin/linux.git
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: a0c5ad307a
("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>
This commit is contained in:
parent
3ec9b3fafc
commit
9f99e50d46
|
@ -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) {
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue