X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ffld%2Ffld_handler.c;h=eae79eaea88d36ab4b206481c1d40f735ab1d3a3;hb=63851b5816bb30687fbf3750380d6b448e9400f1;hp=e40b61a6ebf769489a07587b487590271013bdde;hpb=3f3d6e175b891ddb063cd3b6a08ee1961aca72aa;p=fs%2Flustre-release.git diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index e40b61a..eae79ea 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -180,7 +180,10 @@ int fld_update_from_controller(const struct lu_env *env, 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); } @@ -250,15 +253,13 @@ int fld_server_lookup(const struct lu_env *env, struct lu_server_fld *fld, 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" @@ -465,7 +466,7 @@ int fld_server_init(const struct lu_env *env, struct lu_server_fld *fld, RETURN(rc); } - rc = fld_index_init(env, fld, dt); + rc = fld_index_init(env, fld, dt, type); if (rc) GOTO(out_cache, rc);