@@ -678,9 +678,9 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
if (bits & MDS_INODELOCK_LOOKUP)
d_lustre_revalidate(*de);
} else if (!it_disposition(it, DISP_OPEN_CREATE)) {
- /* If file created on server, don't depend on parent UPDATE
- * lock to unhide it. It is left hidden and next lookup can
- * find it in ll_splice_alias.
+ /*
+ * If file was created on the server, the dentry is revalidated
+ * in ll_create_it if the lock allows for it.
*/
/* Check that parent has UPDATE lock. */
struct lookup_intent parent_it = {
@@ -1063,6 +1063,7 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry,
struct lookup_intent *it, void *secctx, u32 secctxlen)
{
struct inode *inode;
+ u64 bits = 0;
int rc = 0;
CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p), intent=%s\n",
@@ -1088,6 +1089,10 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry,
return rc;
}
+ ll_set_lock_data(ll_i2sbi(dir)->ll_md_exp, inode, it, &bits);
+ if (bits & MDS_INODELOCK_LOOKUP)
+ d_lustre_revalidate(dentry);
+
d_instantiate(dentry, inode);
if (!(ll_i2sbi(inode)->ll_flags & LL_SBI_FILE_SECCTX))