From 7570f87dd231dc537ca4b698ee305d57196704d1 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 28 Oct 2014 12:44:39 +0100 Subject: [PATCH] connection: add kdbus_conn_reply.interrupted Add a new boolean flag to track reply objects affected by interrupted system calls. Treat such object as non-sync in kdbus_conn_work(). This patch does not add any user that sets this flag yet. Signed-off-by: Daniel Mack --- connection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/connection.c b/connection.c index 13ad1d4..00872aa 100644 --- a/connection.c +++ b/connection.c @@ -60,6 +60,7 @@ struct kdbus_conn_reply; * @name_id: ID of the well-known name the original msg was sent to * @sync: The reply block is waiting for synchronous I/O * @waiting: The condition to synchronously wait for + * @interrupted: The sync reply was left in an interrupted state * @err: The error code for the synchronous reply */ struct kdbus_conn_reply { @@ -72,6 +73,7 @@ struct kdbus_conn_reply { u64 name_id; bool sync:1; bool waiting:1; + bool interrupted:1; int err; }; @@ -228,7 +230,7 @@ static void kdbus_conn_work(struct work_struct *work) * the timeout is handled by wait_event_*_timeout(), * so we don't have to care for it here. */ - if (reply->sync) + if (reply->sync && !reply->interrupted) continue; if (reply->deadline_ns > now) { @@ -242,8 +244,10 @@ static void kdbus_conn_work(struct work_struct *work) /* * A zero deadline means the connection died, was * cleaned up already and the notification was sent. + * Don't send notifications for reply trackers that were + * left in an interrupted syscall state. */ - if (reply->deadline_ns != 0) + if (reply->deadline_ns != 0 && !reply->interrupted) kdbus_notify_reply_timeout(conn->bus, reply->reply_dst->id, reply->cookie); -- 2.34.1