Whamcloud - gitweb
LU-13335 ldiskfs: add projid to debug logs 69/46369/8
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 28 Jan 2022 05:14:49 +0000 (22:14 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Jul 2022 06:50:25 +0000 (06:50 +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 log
the projid when it is changed, along with the affected FID.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ibcf3f09ee243ebe052c8f9119383897072ce7057
Reviewed-on: https://review.whamcloud.com/46369
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/osd-ldiskfs/osd_quota.c

index cbb9f15..73c256c 100644 (file)
@@ -3521,6 +3521,8 @@ static int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid)
        unsigned int inode_flags;
        int rc = 0;
 
        unsigned int inode_flags;
        int rc = 0;
 
+       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);
        rc = ll_ioctl_check_project(inode, xflags, projid);
        if (rc)
                RETURN(rc);
index 530e6fc..c69cfcd 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 osd_device *dev;
        struct qsd_instance *qsd;
+       struct lu_fid fid = { 0 };
        struct inode *inode = NULL;
        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;
        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",
 
        LASSERT(oh != NULL);
        LASSERTF(oh->ot_id_cnt <= OSD_MAX_UGID_CNT, "count=%d\n",
@@ -572,13 +581,13 @@ int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh,
        if (!found) {
                /* we need to account for credits for this new ID */
                if (i >= OSD_MAX_UGID_CNT) {
        if (!found) {
                /* we need to account for credits for this new ID */
                if (i >= OSD_MAX_UGID_CNT) {
-                       CERROR("Too many(%d) trans qids!\n", i + 1);
-                       RETURN(-EOVERFLOW);
+                       rc = -EOVERFLOW;
+                       CERROR("%s: too many qids %u > %u on "DFID": rc = %d\n",
+                              osd_name(dev), i + 1, OSD_MAX_UGID_CNT,
+                              PFID(&fid), rc);
+                       RETURN(rc);
                }
 
                }
 
-               if (obj != NULL)
-                       inode = obj->oo_inode;
-
                if (qi->lqi_id.qid_uid == 0) {
                        /* root ID should be always present in the quota file */
                        crd = 1;
                if (qi->lqi_id.qid_uid == 0) {
                        /* root ID should be always present in the quota file */
                        crd = 1;