@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2017, Ericsson AB
* Copyright (c) 2005-2007, 2010-2013, Wind River Systems
- * Copyright (c) 2020-2021, Red Hat Inc
+ * Copyright (c) 2020-2022, Red Hat Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ static void tipc_sub_send_event(struct tipc_subscription *sub,
struct tipc_subscr *s = &sub->evt.s;
struct tipc_event *evt = &sub->evt;
- if (sub->inactive)
+ if (sub->expired)
return;
tipc_evt_write(evt, event, event);
if (p) {
@@ -109,7 +109,9 @@ static void tipc_sub_timeout(struct timer_list *t)
spin_lock(&sub->lock);
tipc_sub_send_event(sub, NULL, TIPC_SUBSCR_TIMEOUT);
- sub->inactive = true;
+
+ /* Block for more events until sub can be deleted from work context */
+ sub->expired = true;
spin_unlock(&sub->lock);
}
@@ -152,7 +154,7 @@ struct tipc_subscription *tipc_sub_subscribe(struct net *net,
INIT_LIST_HEAD(&sub->sub_list);
sub->net = net;
sub->conid = conid;
- sub->inactive = false;
+ sub->expired = false;
memcpy(&sub->evt.s, s, sizeof(*s));
sub->s.seq.type = tipc_sub_read(s, seq.type);
sub->s.seq.lower = lower;
@@ -3,7 +3,7 @@
*
* Copyright (c) 2003-2017, Ericsson AB
* Copyright (c) 2005-2007, 2012-2013, Wind River Systems
- * Copyright (c) 2020-2021, Red Hat Inc
+ * Copyright (c) 2020-2022, Red Hat Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@ struct tipc_subscription {
struct list_head service_list;
struct list_head sub_list;
int conid;
- bool inactive;
+ bool expired;
spinlock_t lock;
};
@@ -3,6 +3,7 @@
*
* Copyright (c) 2012-2013, Wind River Systems
* Copyright (c) 2017-2018, Ericsson AB
+ * Copyright (c) 2020-2022, Redhat Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -105,7 +106,7 @@ struct tipc_conn {
/* An entry waiting to be sent */
struct outqueue_entry {
- bool inactive;
+ bool expired;
struct tipc_event evt;
struct list_head list;
};
@@ -261,7 +262,7 @@ static void tipc_conn_send_to_sock(struct tipc_conn *con)
evt = &e->evt;
spin_unlock_bh(&con->outqueue_lock);
- if (e->inactive)
+ if (e->expired)
tipc_conn_delete_sub(con, &evt->s);
memset(&msg, 0, sizeof(msg));
@@ -325,7 +326,7 @@ void tipc_topsrv_queue_evt(struct net *net, int conid,
e = kmalloc(sizeof(*e), GFP_ATOMIC);
if (!e)
goto err;
- e->inactive = (event == TIPC_SUBSCR_TIMEOUT);
+ e->expired = (event == TIPC_SUBSCR_TIMEOUT);
memcpy(&e->evt, evt, sizeof(*evt));
spin_lock_bh(&con->outqueue_lock);
list_add_tail(&e->list, &con->outqueue);