These fixes were done in user space long ago,
but we forgot to do them in kernel: print correctly
formatted client ID and show correct origin of
error.

Affects: #ASUP-3693

Signed-off-by: Alexey Kuznetsov <[email protected]>
---
 fs/fuse/kio/pcs/fuse_stat.c      | 4 ++--
 fs/fuse/kio/pcs/pcs_cs.c         | 6 ++++--
 fs/fuse/kio/pcs/pcs_prot_types.h | 7 ++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/fs/fuse/kio/pcs/fuse_stat.c b/fs/fuse/kio/pcs/fuse_stat.c
index 41bb9c71af90..9b5825b0bf8b 100644
--- a/fs/fuse/kio/pcs/fuse_stat.c
+++ b/fs/fuse/kio/pcs/fuse_stat.c
@@ -370,8 +370,8 @@ static int do_show_cs_stats(struct pcs_cs *cs, void *ctx)
                }
        } while (read_seqretry(&cs->stat.seqlock, seq));
 
-       seq_printf(m, "%-10llu %d=%-8s %-10llu %-10llu %-11llu",
-               NODE_ARGS(cs->id), rpc_state, pcs_rpc_state_name(rpc_state),
+       seq_printf(m, "%-10lu %d=%-8s %-10llu %-10llu %-11llu",
+               (unsigned long)(cs->id.val), rpc_state, 
pcs_rpc_state_name(rpc_state),
                read_ops_rate.rate / STAT_TIMER_PERIOD,
                write_ops_rate.rate / STAT_TIMER_PERIOD,
                sync_ops_rate.rate / STAT_TIMER_PERIOD);
diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 85e5af2d28c1..d94ac7dc73b2 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -380,10 +380,12 @@ static void cs_response_done(struct pcs_msg *msg)
 
                pcs_map_verify_sync_state(ireq->dentry, ireq, msg);
        } else {
-               FUSE_KDEBUG(ireq->cc->fc, XID_FMT " IO error %d %lu, ireq:%px : 
%llu:%u+%u",
+               FUSE_KDEBUG(ireq->cc->fc, XID_FMT " IO error %d %lu/%lu " 
CUID_FMT ": %llu:%u+%u",
                      XID_ARGS(ireq->iochunk.ir.hbuf.hdr.xid), msg->error.value,
                      msg->error.remote ? (unsigned 
long)msg->error.offender.val : 0UL,
-                     ireq, (unsigned long long)ireq->iochunk.chunk,
+                     msg->rpc ? (unsigned long)msg->rpc->peer_id.val : 0,
+                     CUID_ARGS(ireq->iochunk.ir.hbuf.uid),
+                     (unsigned long long)ireq->iochunk.chunk,
                      (unsigned)ireq->iochunk.offset,
                      (unsigned)ireq->iochunk.size);
        }
diff --git a/fs/fuse/kio/pcs/pcs_prot_types.h b/fs/fuse/kio/pcs/pcs_prot_types.h
index 64718d568b3e..0793391b9964 100644
--- a/fs/fuse/kio/pcs/pcs_prot_types.h
+++ b/fs/fuse/kio/pcs/pcs_prot_types.h
@@ -453,7 +453,7 @@ enum
 #define VER_FMT "%u:%u:%u:%u:%llu"
 #define VER_ARGS(v) (v).master, (v).cluster, (v).file, (v).lost_lease, 
(unsigned long long)(v).chunk
 
-#define XID_FMT "[%u.%llu:%llu]"
+#define XID_FMT "[%u." NODE_FMT ":%llu]"
 #define XID_ARGS(x) (unsigned)(((x).origin.val & PCS_NODE_TYPE_MASK) >> 
PCS_NODE_TYPE_SHIFT), \
                NODE_ARGS((x).origin), (unsigned long long)((x).val)
 
@@ -463,8 +463,9 @@ enum
                *((unsigned int*)&((x).uuid[4])),       \
                *((unsigned int*)&((x).uuid[0]))
 
-#define NODE_FMT "%llu"
-#define NODE_ARGS(id) (unsigned long long)((id).val)
+#define NODE_FMT "%s%llu"
+#define NODE_ARGS(id) (((id).val & PCS_NODE_ALT_MASK) ? "K" : ""), \
+               ((unsigned long long)((id).val) & ~PCS_NODE_ALT_MASK)
 
 #define PEER_FMT "%s#" NODE_FMT
 #define PEER_ARGS(r)  pcs_role_to_str((r)->peer_role), NODE_ARGS((r)->peer_id)
-- 
2.47.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to