[Devel] [PATCH vz10] fs/fuse kio: unlink the tx before completing its msg on RDMA_READ_ACK

Konstantin Khorenko khorenko at virtuozzo.com
Mon Sep 28 18:03:18 MSK 2026


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 at 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 at virtuozzo.com>



More information about the Devel mailing list