summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-10-28 12:44:39 +0100
committerDaniel Mack <daniel@zonque.org>2014-10-28 12:44:39 +0100
commit7570f87dd231dc537ca4b698ee305d57196704d1 (patch)
tree0f139507676bef3b193c334281881fdc78a07a05
parentf2caaa4f4ac4948938b539c54bd4c9168b351ce4 (diff)
downloadkdbus-bus-7570f87dd231dc537ca4b698ee305d57196704d1.tar.gz
kdbus-bus-7570f87dd231dc537ca4b698ee305d57196704d1.tar.bz2
kdbus-bus-7570f87dd231dc537ca4b698ee305d57196704d1.zip
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 <daniel@zonque.org>
-rw-r--r--connection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/connection.c b/connection.c
index 13ad1d4de26..00872aa9695 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);