Whamcloud - gitweb
LU-13335 ldiskfs: add projid to debug logs
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 28 Jan 2022 05:14:49 +0000 (22:14 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 1 Feb 2022 08:29:06 +0000 (08:29 +0000)
There is virtually no tracking of projid changes in osd-ldiskfs,
which makes it very difficult to debug operations therein.

Add some minimal debugging on the client and servers to print
the projid when it is changed, along with the affected FID.

Lustre-change: https://review.whamcloud.com/46369
Lustre-commit: TBD

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ibcf3f09ee243ebe052c8f9119383897072ce7057
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46373
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/file.c
lustre/osd-ldiskfs/osd_quota.c

index 27b2be4..5e8bbb5 100644 (file)
@@ -3481,6 +3481,8 @@ static int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid)
        struct iattr *attr;
        int flags;
 
+       CDEBUG(D_QUOTA, DFID" xflags=%x projid=%u\n",
+              PFID(ll_inode2fid(inode)), xflags, projid);
        rc = ll_ioctl_check_project(inode, xflags, projid);
        if (rc)
                RETURN(rc);
index 530e6fc..a67dc5b 100644 (file)
@@ -541,12 +541,21 @@ int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh,
 {
        struct osd_device *dev;
        struct qsd_instance *qsd;
+       struct lu_fid fid = { 0 };
        struct inode *inode = NULL;
+       unsigned long long ino =  0;
        int i, rc = 0, crd;
        __u8 res = qi->lqi_is_blk ? LQUOTA_RES_DT : LQUOTA_RES_MD;
        bool found = false;
 
        ENTRY;
+       if (obj) {
+               fid = *lu_object_fid(&obj->oo_dt.do_lu);
+               inode = obj->oo_inode;
+               ino = inode ? inode->i_ino : 0;
+       }
+       CDEBUG(D_QUOTA, "fid="DFID" ino=%llu type=%u, id=%llu\n",
+              PFID(&fid), ino, qi->lqi_type, qi->lqi_id.qid_uid);
 
        LASSERT(oh != NULL);
        LASSERTF(oh->ot_id_cnt <= OSD_MAX_UGID_CNT, "count=%d\n",