From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Liu Kui <kui.liu@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2] fs/fuse kio: drop the done parameter of rio_msg_sent()
Date: Tue, 29 Sep 2026 19:38:14 +0200 [thread overview]
Message-ID: <20260929-prep-kh-vstor-141673-kio-read-ack-order-v2-1-bf05c0d2da51@virtuozzo.com> (raw)
The tx and done parameters are mutually exclusive:
* done == 1 ignores tx
* done == 0 requires it
Let tx == NULL mean the message is complete instead. This also stops
rio_submit() from passing an uninitialized tx on the PCS_MSG_ABORTED
path (harmless, the done branch never read it).
https://virtuozzo.atlassian.net/browse/VSTOR-141673
Feature: vStorage
Suggested-by: Liu Kui <kui.liu@virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Changes in v2:
- droppped: fs/fuse kio: unlink the tx before completing its msg on RDMA_READ_ACK
- Link to v1: http://lore.virtuozzo.com/20260928-prep-kh-vstor-141673-kio-read-ack-order-v1-1-6069e78cac95@virtuozzo.com
---
fs/fuse/kio/pcs/pcs_rdma_io.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/fuse/kio/pcs/pcs_rdma_io.c b/fs/fuse/kio/pcs/pcs_rdma_io.c
index 2001297010a64..59a3c1286363d 100644
--- a/fs/fuse/kio/pcs/pcs_rdma_io.c
+++ b/fs/fuse/kio/pcs/pcs_rdma_io.c
@@ -151,9 +151,10 @@ static struct pcs_msg *rio_dequeue_reserved_msg(struct pcs_rdmaio *rio)
return msg;
}
-static void rio_msg_sent(struct pcs_rdmaio *rio, struct rio_tx *tx, struct pcs_msg *msg, int done)
+/* tx == NULL means the message is complete, no tx tracks it anymore */
+static void rio_msg_sent(struct pcs_rdmaio *rio, struct rio_tx *tx, struct pcs_msg *msg)
{
- if (done) {
+ if (!tx) {
clear_and_wake_up_bit(PCS_MSG_BUSY, &msg->flags);
pcs_msg_sent(msg);
msg->done(msg);
@@ -630,7 +631,7 @@ static int rio_submit(struct pcs_rdmaio *rio, struct pcs_msg *msg, int type, u64
if (unlikely(test_bit(PCS_MSG_ABORTED, &msg->flags))) {
pcs_set_local_error(&msg->error, PCS_ERR_CANCEL_REQUEST);
- rio_msg_sent(rio, tx, msg, 1);
+ rio_msg_sent(rio, NULL, msg);
return 0;
}
}
@@ -725,7 +726,7 @@ static int rio_submit(struct pcs_rdmaio *rio, struct pcs_msg *msg, int type, u64
* in a single RX queue are guaranteed to come in order, there
* is no race in this case.
*/
- rio_msg_sent(rio, tx, msg, rb == NULL);
+ rio_msg_sent(rio, rb ? tx : NULL, msg);
}
return 0;
@@ -928,7 +929,7 @@ static int rio_handle_rx_read_ack(struct pcs_rdmaio *rio,
list_for_each_entry(tx, &rio->active_txs, list)
if (tx->xid == rack->xid) {
- rio_msg_sent(rio, NULL, tx->msg, 1);
+ rio_msg_sent(rio, NULL, tx->msg);
tx->msg = NULL;
list_del(&tx->list);
rio_handle_tx(rio, tx, !rack->status);
@@ -1428,7 +1429,7 @@ static void rio_cleanup(struct pcs_rdmaio *rio)
BUG_ON(!msg);
rio_put_tx(rio->dev, tx);
pcs_set_local_error(&msg->error, rio->rio_error);
- rio_msg_sent(rio, NULL, msg, 1);
+ rio_msg_sent(rio, NULL, msg);
}
}
---
base-commit: 0679f0d70523972eec3a0643565521d93e26eb9c
change-id: 20260928-prep-kh-vstor-141673-kio-read-ack-order-9fc2b40d4077
Best regards,
--
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next reply other threads:[~2026-09-29 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 17:38 Konstantin Khorenko [this message]
2026-09-29 17:40 ` no-reply
2026-09-29 17:41 ` 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=20260929-prep-kh-vstor-141673-kio-read-ack-order-v2-1-bf05c0d2da51@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--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.