74096c
From 8267e5e97327633bf21fd02df8d52e3a97f0f9ea Mon Sep 17 00:00:00 2001
74096c
From: Ashish Pandey <aspandey@redhat.com>
74096c
Date: Wed, 4 Dec 2019 17:06:18 +0530
74096c
Subject: [PATCH 421/449] Improve logging in EC, client and lock translator
74096c
74096c
BUG: 1787294
74096c
> Upstream patch: https://review.gluster.org/#/c/glusterfs/+/23814/
74096c
> Change-Id: I98af8672a25ff9fd9dba91a2e1384719f9155255
74096c
> Fixes: bz#1779760
74096c
74096c
Change-Id: I5cb04993f12d6248f2349a0c5a9e2c0ceecaf528
74096c
Reviewed-on: https://code.engineering.redhat.com/gerrit/202533
74096c
Tested-by: Ashish Pandey <aspandey@redhat.com>
74096c
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74096c
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
74096c
---
74096c
 xlators/cluster/ec/src/ec-combine.c  |  5 +++--
74096c
 xlators/cluster/ec/src/ec-common.c   |  2 +-
74096c
 xlators/features/locks/src/inodelk.c | 12 ++++++++----
74096c
 3 files changed, 12 insertions(+), 7 deletions(-)
74096c
74096c
diff --git a/xlators/cluster/ec/src/ec-combine.c b/xlators/cluster/ec/src/ec-combine.c
74096c
index c5af2ab..99e5534 100644
74096c
--- a/xlators/cluster/ec/src/ec-combine.c
74096c
+++ b/xlators/cluster/ec/src/ec-combine.c
74096c
@@ -179,13 +179,14 @@ ec_iatt_combine(ec_fop_data_t *fop, struct iatt *dst, struct iatt *src,
74096c
                    "links: %u-%u, uid: %u-%u, gid: %u-%u, "
74096c
                    "rdev: %" PRIu64 "-%" PRIu64 ", size: %" PRIu64 "-%" PRIu64
74096c
                    ", "
74096c
-                   "mode: %o-%o)",
74096c
+                   "mode: %o-%o), %s",
74096c
                    dst[i].ia_ino, src[i].ia_ino, dst[i].ia_nlink,
74096c
                    src[i].ia_nlink, dst[i].ia_uid, src[i].ia_uid, dst[i].ia_gid,
74096c
                    src[i].ia_gid, dst[i].ia_rdev, src[i].ia_rdev,
74096c
                    dst[i].ia_size, src[i].ia_size,
74096c
                    st_mode_from_ia(dst[i].ia_prot, dst[i].ia_type),
74096c
-                   st_mode_from_ia(src[i].ia_prot, dst[i].ia_type));
74096c
+                   st_mode_from_ia(src[i].ia_prot, dst[i].ia_type),
74096c
+                   ec_msg_str(fop));
74096c
 
74096c
             return 0;
74096c
         }
74096c
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
74096c
index 5cae37b..e580bfb 100644
74096c
--- a/xlators/cluster/ec/src/ec-common.c
74096c
+++ b/xlators/cluster/ec/src/ec-common.c
74096c
@@ -2240,7 +2240,7 @@ ec_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
74096c
 
74096c
     if (op_ret < 0) {
74096c
         gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_UNLOCK_FAILED,
74096c
-               "entry/inode unlocking failed (%s)", ec_fop_name(link->fop->id));
74096c
+               "entry/inode unlocking failed :(%s)", ec_msg_str(link->fop));
74096c
     } else {
74096c
         ec_trace("UNLOCKED", link->fop, "lock=%p", link->lock);
74096c
     }
74096c
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
74096c
index df00ede..a9c42f1 100644
74096c
--- a/xlators/features/locks/src/inodelk.c
74096c
+++ b/xlators/features/locks/src/inodelk.c
74096c
@@ -502,22 +502,26 @@ static pl_inode_lock_t *
74096c
 __inode_unlock_lock(xlator_t *this, pl_inode_lock_t *lock, pl_dom_list_t *dom)
74096c
 {
74096c
     pl_inode_lock_t *conf = NULL;
74096c
+    inode_t *inode = NULL;
74096c
+
74096c
+    inode = lock->pl_inode->inode;
74096c
 
74096c
     conf = find_matching_inodelk(lock, dom);
74096c
     if (!conf) {
74096c
         gf_log(this->name, GF_LOG_ERROR,
74096c
                " Matching lock not found for unlock %llu-%llu, by %s "
74096c
-               "on %p",
74096c
+               "on %p for gfid:%s",
74096c
                (unsigned long long)lock->fl_start,
74096c
                (unsigned long long)lock->fl_end, lkowner_utoa(&lock->owner),
74096c
-               lock->client);
74096c
+               lock->client, inode ? uuid_utoa(inode->gfid) : "UNKNOWN");
74096c
         goto out;
74096c
     }
74096c
     __delete_inode_lock(conf);
74096c
     gf_log(this->name, GF_LOG_DEBUG,
74096c
-           " Matching lock found for unlock %llu-%llu, by %s on %p",
74096c
+           " Matching lock found for unlock %llu-%llu, by %s on %p for gfid:%s",
74096c
            (unsigned long long)lock->fl_start, (unsigned long long)lock->fl_end,
74096c
-           lkowner_utoa(&lock->owner), lock->client);
74096c
+           lkowner_utoa(&lock->owner), lock->client,
74096c
+           inode ? uuid_utoa(inode->gfid) : "UNKNOWN");
74096c
 
74096c
 out:
74096c
     return conf;
74096c
-- 
74096c
1.8.3.1
74096c