From: Alex Zhuravlev Date: Sat, 21 Aug 2021 15:45:53 +0000 (+0300) Subject: LU-8704 osp: update local fldb cache X-Git-Tag: 2.15.56~118 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F44720%2F30;p=fs%2Flustre-release.git LU-8704 osp: update local fldb cache update local fldb cache during precreate. this is to avoid a situation when LOD is generating LOVEA and has to lookup in FLDB. in turn this may lead to an RPC with a local transaction running. not good. Signed-off-by: Alex Zhuravlev Change-Id: Iadf89eddcef88750d234b0139b67e04715e68855 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/44720 Reviewed-by: Sergey Cheremencev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index 2c04b5e..44129f0 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -447,6 +447,23 @@ out: RETURN(rc); } +static void osp_update_fldb_cache(const struct lu_env *env, + struct osp_device *osp, + struct lu_fid *fid) +{ + struct lu_seq_range range = { 0 }; + struct lu_server_fld *server_fld; + struct lu_site *site; + + site = osp->opd_storage->dd_lu_dev.ld_site; + server_fld = lu_site2seq(site)->ss_server_fld; + if (!server_fld) + return; + + fld_range_set_type(&range, LU_SEQ_RANGE_ANY); + fld_server_lookup(env, server_fld, fid_seq(fid), &range); +} + /** * Switch to another sequence * @@ -506,6 +523,9 @@ static int osp_precreate_rollover_new_seq(struct lu_env *env, osp->opd_pre_last_created_fid = *fid; spin_unlock(&osp->opd_pre_lock); + if (!rc) + osp_update_fldb_cache(env, osp, fid); + RETURN(rc); } @@ -712,6 +732,10 @@ out_req: osp_pre_update_status(d, rc); ptlrpc_req_finished(req); + + if (!rc) + osp_update_fldb_cache(env, d, fid); + RETURN(rc); }