Commit 4518dfcf authored by Amir Goldstein's avatar Amir Goldstein Committed by Miklos Szeredi

ovl: fix lookup of indexed hardlinks with metacopy

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: 28166ab3 ("ovl: initialize OVL_UPPERDATA in ovl_lookup()")
Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 81a33c1e
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment