From: no-reply@sashiko.virtuozzo.com
To: Alexey Kuznetsov <kuznet@virtuozzo.com>,
devel@openvz.org, khorenko@virtuozzo.com, kui.liu@virtuozzo.com,
azaitsev@virtuozzo.com
Subject: Re: [Devel] [PATCH hci-8.1] fs/fuse/pcs: fix problems in logging
Date: Tue, 17 Nov 2026 13:30:30 +0000 [thread overview]
Message-ID: <010701a1e9b3b40c-145e8b3d-d4ff-4545-8b02-85b75605f30c-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <avxV5vl8EDa1S/OF@mops2>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] fuse/pcs: commit message omits log format changes made by the
patch
- [Low] fuse/pcs: 64-bit CS id narrowed to unsigned long in cs stats and
IO error log
--
commit 30a53ff9513c7c968e8dfdd8ad0c3748ecdf8bf6
Author: Alexey Kuznetsov <kuznet@virtuozzo.com>
fs/fuse/pcs: fix problems in logging
This patch changes the PCS node ID formatting macros and the IO error debug line in cs_response_done(). It also changes how the cs_stats ID column is printed.
> fs/fuse/pcs: fix problems in logging
>
> 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>
[Severity: Low]
Does the commit message cover everything the diff changes?
NODE_FMT and NODE_ARGS are redefined globally, along with XID_FMT. Every trace site that uses them now prints a "K" prefix and masks the top bit of the ID. The message doesn't describe this, and it doesn't say what "correct origin" means.
The IO error line in cs_response_done() also drops the ireq pointer and adds the rpc peer id and the chunk uid. The chunk uid isn't a client ID. The cs_stats ID column in do_show_cs_stats() now bypasses NODE_ARGS as well. Could the message list these behaviour changes?
> 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),
[Severity: Low]
Is the cast to unsigned long safe here? cs->id.val is a u64, so on a 32-bit build the upper 32 bits are dropped. This column also no longer goes through NODE_ARGS, so it skips the ALT-bit handling this patch adds elsewhere. Would (unsigned long long) with %llu avoid both problems?
[ ... ]
> 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);
[Severity: Low]
The new peer_id argument has the same narrowing: peer_id.val is a u64 and is cast to unsigned long, so the high bits are lost on 32-bit. The offender id on the line above already did this. Could both use unsigned long long with %llu?
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/avxV5vl8EDa1S/OF@mops2?part=1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-17 13:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 13:25 Alexey Kuznetsov
2026-11-17 13:30 ` no-reply [this message]
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=010701a1e9b3b40c-145e8b3d-d4ff-4545-8b02-85b75605f30c-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=azaitsev@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=kui.liu@virtuozzo.com \
--cc=kuznet@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.