RETURN(ERR_PTR(-ESTALE));
}
- /**
- * It is an anonymous dentry without OST objects created yet.
- * We have to find the parent to tell MDS how to init lov objects.
- */
- if (S_ISREG(inode->i_mode) && !ll_i2info(inode)->lli_has_smd &&
- parent != NULL && !fid_is_zero(parent)) {
+ result = d_obtain_alias(inode);
+ if (IS_ERR(result)) {
+ iput(inode);
+ RETURN(result);
+ }
+
+ /**
+ * In case d_obtain_alias() found a disconnected dentry, always update
+ * lli_pfid to allow later operation (normally open) have parent fid,
+ * which may be used by MDS to create data.
+ */
+ if (parent != NULL) {
struct ll_inode_info *lli = ll_i2info(inode);
spin_lock(&lli->lli_lock);
spin_unlock(&lli->lli_lock);
}
- result = d_obtain_alias(inode);
- if (IS_ERR(result)) {
- iput(inode);
- RETURN(result);
- }
-
RETURN(result);
}