From: Jon M. <jon...@er...> - 2019-03-20 09:59:18
|
From: Erik Hugne <eri...@gm...> When cancelling a subscription, we have to clear the cancel bit in the request before iterating over any established subscriptions with memcmp. Otherwise no subscription will ever be found, and it will not be possible to explicitly unsubscribe individual subscriptions. Fixes: 8985ecc7c1e0 ("tipc: simplify endianness handling in topology subscriber") Signed-off-by: Erik Hugne <eri...@gm...> Signed-off-by: Jon Maloy <jon...@er...> --- net/tipc/topsrv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index 4a708a4..b05a89a 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c @@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, struct tipc_subscription *sub; if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { + s->filter ^= __constant_ntohl(TIPC_SUB_CANCEL); tipc_conn_delete_sub(con, s); return 0; } -- 2.1.4 |
From: David M. <da...@da...> - 2019-03-20 18:17:44
|
From: Jon Maloy <jon...@er...> Date: Wed, 20 Mar 2019 10:59:03 +0100 > From: Erik Hugne <eri...@gm...> > > When cancelling a subscription, we have to clear the cancel bit in the > request before iterating over any established subscriptions with memcmp. > Otherwise no subscription will ever be found, and it will not be > possible to explicitly unsubscribe individual subscriptions. ... > diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c > index 4a708a4..b05a89a 100644 > --- a/net/tipc/topsrv.c > +++ b/net/tipc/topsrv.c > @@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, > struct tipc_subscription *sub; > > if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { > + s->filter ^= __constant_ntohl(TIPC_SUB_CANCEL); > tipc_conn_delete_sub(con, s); It is confusing to say we have to "clear" some bit in a certain situation and then use a xor operation which "inverts" a bit. Please use "&= ~VAL" instead. Thank you. |
From: <eri...@gm...> - 2019-03-20 20:58:18
|
From: Erik Hugne <eri...@gm...> When cancelling a subscription, we have to clear the cancel bit in the request before iterating over any established subscriptions with memcmp. Otherwise no subscription will ever be found, and it will not be possible to unsubscribe. Signed-off-by: Erik Hugne <eri...@gm...> --- v2: clear bit in a more sensible way.. (comment from davem) net/tipc/topsrv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index 4a708a4e8583..b45932d78004 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c @@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, struct tipc_subscription *sub; if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { + s->filter &= __constant_ntohl(~TIPC_SUB_CANCEL); tipc_conn_delete_sub(con, s); return 0; } -- 2.14.1 |
From: Jon M. <jon...@er...> - 2019-03-21 08:12:22
|
From: Erik Hugne <eri...@gm...> When cancelling a subscription, we have to clear the cancel bit in the request before iterating over any established subscriptions with memcmp. Otherwise no subscription will ever be found, and it will not be possible to explicitly unsubscribe individual subscriptions. Fixes: 8985ecc7c1e0 ("tipc: simplify endianness handling in topology subscriber") Signed-off-by: Erik Hugne <eri...@gm...> Signed-off-by: Jon Maloy <jon...@er...> --- v2: clear bit in a more sensible way.. (comment from davem) --- net/tipc/topsrv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index 4a708a4..b45932d7 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c @@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, struct tipc_subscription *sub; if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { + s->filter &= __constant_ntohl(~TIPC_SUB_CANCEL); tipc_conn_delete_sub(con, s); return 0; } -- 2.1.4 |
From: David M. <da...@da...> - 2019-03-21 16:10:21
|
From: Jon Maloy <jon...@er...> Date: Thu, 21 Mar 2019 09:11:59 +0100 > From: Erik Hugne <eri...@gm...> > > When cancelling a subscription, we have to clear the cancel bit in the > request before iterating over any established subscriptions with memcmp. > Otherwise no subscription will ever be found, and it will not be > possible to explicitly unsubscribe individual subscriptions. > > Fixes: 8985ecc7c1e0 ("tipc: simplify endianness handling in topology subscriber") > Signed-off-by: Erik Hugne <eri...@gm...> > Signed-off-by: Jon Maloy <jon...@er...> > > --- > v2: clear bit in a more sensible way.. (comment from davem) Applied and queued up for -stable. Thanks for following up. |