Skip to content

Commit 9f99e50

Browse files
amir73ilMiklos Szeredi
authored andcommitted
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: a0c5ad3 ("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>
1 parent 3ec9b3f commit 9f99e50

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/overlayfs/inode.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,10 @@ int ovl_getattr(const struct path *path, struct kstat *stat,
118118
*/
119119
if (ovl_test_flag(OVL_INDEX, d_inode(dentry)) ||
120120
(!ovl_verify_lower(dentry->d_sb) &&
121-
(is_dir || lowerstat.nlink == 1)))
121+
(is_dir || lowerstat.nlink == 1))) {
122122
stat->ino = lowerstat.ino;
123-
124-
if (samefs)
125-
WARN_ON_ONCE(stat->dev != lowerstat.dev);
126-
else
127123
stat->dev = ovl_get_pseudo_dev(dentry);
124+
}
128125
}
129126
if (samefs) {
130127
/*

0 commit comments

Comments
 (0)