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);
}
.lgd_found = 0,
};
struct md_op_data *op_data;
+ __u64 pos = 0;
int rc;
ENTRY;
if (IS_ERR(op_data))
GOTO(out, rc = PTR_ERR(op_data));
- op_data->op_hash_offset = 0;
op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
mutex_lock(&dir->i_mutex);
#ifdef HAVE_DIR_CONTEXT
- rc = ll_dir_read(dir, op_data, &lgd.ctx);
+ rc = ll_dir_read(dir, &pos, op_data, &lgd.ctx);
#else
- rc = ll_dir_read(dir, op_data, &lgd, ll_nfs_get_name_filldir);
+ rc = ll_dir_read(dir, &pos, op_data, &lgd, ll_nfs_get_name_filldir);
#endif
mutex_unlock(&dir->i_mutex);
ll_finish_md_op_data(op_data);