From: Sebastien Buisson Date: Wed, 22 Jun 2022 08:20:49 +0000 (+0200) Subject: EX-4333 sec: traces for supplementary groups handling X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=5359445803cdfc530ced2291e04a1b6a7df4d48e;p=fs%2Flustre-release.git EX-4333 sec: traces for supplementary groups handling Add traces in the code to ease understanding of supplementary groups handling, in particular for the INTERNAL identity_upcall. Change-Id: I4b2298cf5c3b400e7a1436384653ce01a462a2e0 Test-Parameters: trivial Signed-off-by: Sebastien Buisson Reviewed-on: https://review.whamcloud.com/47697 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index dc69b18..25a0536 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -892,8 +892,13 @@ int ll_intent_lock(struct obd_export *exp, struct md_op_data *op_data, ENTRY; +intent: rc = md_intent_lock(exp, op_data, it, reqp, cb_blocking, extra_lock_flags); + CDEBUG(D_VFSTRACE, + "intent lock %d on i1 "DFID" suppgids %d %d: rc %d\n", + it->it_op, PFID(&op_data->op_fid1), + op_data->op_suppgids[0], op_data->op_suppgids[1], rc); if (rc == -EACCES && tryagain && it->it_op & IT_OPEN && it_disposition(it, DISP_OPEN_DENY) && *reqp) { struct mdt_body *body; @@ -901,6 +906,7 @@ int ll_intent_lock(struct obd_export *exp, struct md_op_data *op_data, body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY); new_suppgid = body->mbo_gid; + CDEBUG(D_SEC, "new suppgid from body: %d\n", new_suppgid); if (op_data->op_suppgids[0] == body->mbo_gid || op_data->op_suppgids[1] == body->mbo_gid || !in_group_p(make_kgid(&init_user_ns, body->mbo_gid))) { @@ -913,6 +919,8 @@ int ll_intent_lock(struct obd_export *exp, struct md_op_data *op_data, new_suppgid = get_uc_group_from_acl(acl, accmode); posix_acl_release(acl); + CDEBUG(D_SEC, "new suppgid from acl: %d\n", + new_suppgid); if (new_suppgid == (__u32)__kgid_val(INVALID_GID)) GOTO(out, rc = -EACCES); @@ -924,8 +932,8 @@ int ll_intent_lock(struct obd_export *exp, struct md_op_data *op_data, ptlrpc_req_finished(*reqp); *reqp = NULL; ll_intent_release(it); - rc = md_intent_lock(exp, op_data, it, reqp, cb_blocking, - extra_lock_flags); + tryagain = false; + goto intent; } out: diff --git a/lustre/obdclass/upcall_cache.c b/lustre/obdclass/upcall_cache.c index a6de37b..b1a4210 100644 --- a/lustre/obdclass/upcall_cache.c +++ b/lustre/obdclass/upcall_cache.c @@ -177,6 +177,9 @@ static inline int refresh_entry(struct upcall_cache *cache, spin_unlock(&cache->uc_lock); put_entry(cache, entry); + CDEBUG(D_OTHER, + "%s: INTERNAL refreshed entry for '%llu' with %d groups\n", + cache->uc_name, entry->ue_key, ngroups); return 0; } @@ -263,6 +266,11 @@ find_again: * groups and all other groups already in cache */ if (!supp_in_ginfo[0] || !supp_in_ginfo[1]) { + CDEBUG(D_OTHER, + "%s: INTERNAL might add suppgids %d,%d for entry '%llu'\n", + cache->uc_name, uc->uc_suppgids[0], + uc->uc_suppgids[1], entry->ue_key); + ngroups += !supp_in_ginfo[0] + !supp_in_ginfo[1]; CFS_ALLOC_PTR_ARRAY(grouplist, ngroups); if (grouplist == NULL)