All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Alexey Kuznetsov <kuznet@virtuozzo.com>
To: devel@openvz.org, khorenko@virtuozzo.com, kui.liu@virtuozzo.com,
	azaitsev@virtuozzo.com
Subject: [Devel] [PATCH hci-8.1] fs/fuse/pcs: fix problems in logging
Date: Tue, 17 Nov 2026 21:25:58 +0800	[thread overview]
Message-ID: <avxV5vl8EDa1S/OF@mops2> (raw)

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 <kuznet@virtuozzo.com>
---
 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
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-11-17 13:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:25 Alexey Kuznetsov [this message]
2026-11-17 13:30 ` no-reply
2026-11-17 15:06 ` Konstantin Khorenko
2026-11-17 15:06 ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avxV5vl8EDa1S/OF@mops2 \
    --to=kuznet@virtuozzo.com \
    --cc=azaitsev@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=kui.liu@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.