kdbus: don't unlink _synchronous_ replies 32/265032/1
authorAdrian Szyndela <adrian.s@samsung.com>
Thu, 7 Oct 2021 09:27:38 +0000 (11:27 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Thu, 7 Oct 2021 09:27:38 +0000 (11:27 +0200)
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 unlinked and the restarted call
can't pick it up anymore.

This commit leaves all synchronous replies linked.

This way:
- non-synchronous 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: If162f96a14d51d6a4475fe5c55039dc92236b19a
Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
ipc/kdbus/connection.c

index 6479c04..a40be5f 100644 (file)
@@ -1135,7 +1135,7 @@ static int kdbus_conn_reply(struct kdbus_conn *src,
        if (reply) {
                if (reply->sync)
                        wake = kdbus_reply_ref(reply);
-               if (!reply->interrupted)
+               else
                        kdbus_reply_unlink(reply);
        }
        mutex_unlock(&dst->lock);