ovl: set lower layer st_dev only if setting lower st_ino
Amir Goldstein
maintainerPATCH 1/1 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.
--- fs/overlayfs/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Miklos,
This fixes a very obvious (to me) bug.
I have a WIP unionmount-testsuite check for this.
Will sort it out and push it to my tree later.
Also pushed ovl-xino branch rebased on this bug fix.
Thanks,
Amir.
fs/overlayfs/inode.c +2 -5
@@ -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) {/*
Signature · 1 line
2.7.4
Amir Goldstein
maintainerQuoted 10 lines · Amir Goldstein
For broken hardlinks, we do not return lower
st_ino, so we should also not return lower pseudost_dev.Fixes a0c5ad307ac0 ("ovl: relax same fs constraint for constant st_ino")Cc <[email protected]> #v4.15Signed-off-by Amir Goldstein <[email protected]>--- fs/overlayfs/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Quoted 9 lines
Miklos,
This fixes a very obvious (to me) bug.
I have a WIP unionmount-testsuite check for this.
Will sort it out and push it to my tree later.Also pushed ovl-xino branch rebased on this bug fix.
OOPS, just saw that ovl-xino is already in overlayfs-next, I can rebase the fix and re-send tomorrow.
Thanks,
Amir.