Skip to content

Commit

Permalink
ovl: fix lookup of indexed hardlinks with metacopy
Browse files Browse the repository at this point in the history
We recently moved setting inode flag OVL_UPPERDATA to ovl_lookup().

When looking up an overlay dentry, upperdentry may be found by index
and not by name.  In that case, we fail to read the metacopy xattr
and falsly set the OVL_UPPERDATA on the overlay inode.

This caused a regression in xfstest overlay/033 when run with
OVERLAY_MOUNT_OPTIONS="-o metacopy=on".

Fixes: 28166ab ("ovl: initialize OVL_UPPERDATA in ovl_lookup()")
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
amir73il authored and Miklos Szeredi committed Jul 16, 2020
1 parent 81a33c1 commit 4518dfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/overlayfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,10 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
upperredirect = NULL;
goto out_free_oe;
}
err = ovl_check_metacopy_xattr(upperdentry);
if (err < 0)
goto out_free_oe;
uppermetacopy = err;
}

if (upperdentry || ctr) {
Expand Down

0 comments on commit 4518dfc

Please sign in to comment.