OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Liu Kui <kui.liu@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH vz10] fs/fuse kio: unlink the tx before completing its msg on RDMA_READ_ACK
Date: Mon, 28 Sep 2026 17:03:18 +0200	[thread overview]
Message-ID: <20260928-prep-kh-vstor-141673-kio-read-ack-order-v1-1-6069e78cac95@virtuozzo.com> (raw)

Use safe style: remove the tx from the list and clear tx->msg
before completing the message, so the list never exposes a dead
pointer.

Right now it's not a problem: currently nobody reads ex->msg without
ep->mutex, so it's a precausion.

https://virtuozzo.atlassian.net/browse/VSTOR-141673

Feature: vStorage
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_rdma_io.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_rdma_io.c b/fs/fuse/kio/pcs/pcs_rdma_io.c
index 2001297010a64..c582b583cf797 100644
--- a/fs/fuse/kio/pcs/pcs_rdma_io.c
+++ b/fs/fuse/kio/pcs/pcs_rdma_io.c
@@ -928,9 +928,11 @@ 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);
-			tx->msg = NULL;
+			struct pcs_msg *msg = tx->msg;
+
 			list_del(&tx->list);
+			tx->msg = NULL;
+			rio_msg_sent(rio, NULL, msg, 1);
 			rio_handle_tx(rio, tx, !rack->status);
 			return 0;
 		}

---
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

             reply	other threads:[~2026-09-28 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 15:03 Konstantin Khorenko [this message]
2026-09-29 16:57 ` 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=20260928-prep-kh-vstor-141673-kio-read-ack-order-v1-1-6069e78cac95@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox