From f36833053065e3e607e747d40f81cead512565a3 Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Thu, 30 Sep 2021 15:44:57 +0900 Subject: [PATCH] kdbus: don't unlink synchronous replies When a signal breaks a synchronous call, and a reply is received before restart is executed, then the reply is unlinked and the restarted call can't pick it up anymore. But keeping only interrupted synchronous calls linked is not enough. If a reply comes just after the signal, before marking the reply structure as interrupted, then the reply is - again - unlinked and the restarted call can't pick it up anymore. This commit leaves all synchronous replies linked. This way: - asynchronous calls work as before the changes - replies are unlinked by the replier in kdbus_conn_reply(); - replies for synchronous calls are unlinked by the caller in kdbus_conn_wait_reply(). Change-Id: I0e3d8f53cf24a0aa8c59244e0768eebeb3fee110 Signed-off-by: Adrian Szyndela --- ipc/kdbus/connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c index 02deba36..a40be5f 100644 --- a/ipc/kdbus/connection.c +++ b/ipc/kdbus/connection.c @@ -1135,7 +1135,8 @@ static int kdbus_conn_reply(struct kdbus_conn *src, if (reply) { if (reply->sync) wake = kdbus_reply_ref(reply); - kdbus_reply_unlink(reply); + else + kdbus_reply_unlink(reply); } mutex_unlock(&dst->lock); -- 2.7.4