if (lsra->lsra_lsr[i].lsr_index != index)
GOTO(out, rc = -EINVAL);
+ mutex_lock(&fld->lsf_lock);
rc1 = fld_insert_entry(env, fld, &lsra->lsra_lsr[i]);
+ mutex_unlock(&fld->lsf_lock);
+
if (rc1 != 0)
GOTO(out, rc = rc1);
}
rc = fld_name_to_index(fld->lsf_name, &index);
if (rc < 0)
RETURN(rc);
- else
- rc = 0;
- if (index == 0) {
+ if (index == 0 && rc == LDD_F_SV_TYPE_MDT) {
/* On server side, all entries should be in cache.
* If we can not find it in cache, just return error */
CERROR("%s: Cannot find sequence "LPX64": rc = %d\n",
- fld->lsf_name, seq, -EIO);
- RETURN(-EIO);
+ fld->lsf_name, seq, -ENOENT);
+ RETURN(-ENOENT);
} else {
if (fld->lsf_control_exp == NULL) {
CERROR("%s: lookup "LPX64", but not connects to MDT0"
RETURN(rc);
}
- rc = fld_index_init(env, fld, dt);
+ rc = fld_index_init(env, fld, dt, type);
if (rc)
GOTO(out_cache, rc);