Whamcloud - gitweb
EX-4333 sec: traces for supplementary groups handling
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 22 Jun 2022 08:20:49 +0000 (10:20 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 15 Jul 2022 04:31:03 +0000 (04:31 +0000)
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 <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/47697
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/namei.c
lustre/obdclass/upcall_cache.c

index dc69b18..25a0536 100644 (file)
@@ -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:
index a6de37b..b1a4210 100644 (file)
@@ -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)