* [PATCH net] mptcp: fix bit MPTCP_PUSH_PENDING tests
@ 2021-03-12 7:41 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-03-12 7:41 UTC (permalink / raw)
To: Mat Martineau, Paolo Abeni
Cc: Matthieu Baerts, David S. Miller, Jakub Kicinski, netdev, mptcp,
kernel-janitors
The MPTCP_PUSH_PENDING define is 6 and these tests should be testing if
BIT(6) is set.
Fixes: c2e6048fa1cf ("mptcp: fix race in release_cb")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
net/mptcp/protocol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 76958570ae7f..1590b9d4cde2 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2968,7 +2968,7 @@ static void mptcp_release_cb(struct sock *sk)
for (;;) {
flags = 0;
if (test_and_clear_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->flags))
- flags |= MPTCP_PUSH_PENDING;
+ flags |= BIT(MPTCP_PUSH_PENDING);
if (!flags)
break;
@@ -2981,7 +2981,7 @@ static void mptcp_release_cb(struct sock *sk)
*/
spin_unlock_bh(&sk->sk_lock.slock);
- if (flags & MPTCP_PUSH_PENDING)
+ if (flags & BIT(MPTCP_PUSH_PENDING))
__mptcp_push_pending(sk, 0);
cond_resched();
--
2.30.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [MPTCP] [PATCH net] mptcp: fix bit MPTCP_PUSH_PENDING tests
@ 2021-03-12 7:41 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-03-12 7:41 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
The MPTCP_PUSH_PENDING define is 6 and these tests should be testing if
BIT(6) is set.
Fixes: c2e6048fa1cf ("mptcp: fix race in release_cb")
Signed-off-by: Dan Carpenter <dan.carpenter(a)oracle.com>
---
net/mptcp/protocol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 76958570ae7f..1590b9d4cde2 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2968,7 +2968,7 @@ static void mptcp_release_cb(struct sock *sk)
for (;;) {
flags = 0;
if (test_and_clear_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->flags))
- flags |= MPTCP_PUSH_PENDING;
+ flags |= BIT(MPTCP_PUSH_PENDING);
if (!flags)
break;
@@ -2981,7 +2981,7 @@ static void mptcp_release_cb(struct sock *sk)
*/
spin_unlock_bh(&sk->sk_lock.slock);
- if (flags & MPTCP_PUSH_PENDING)
+ if (flags & BIT(MPTCP_PUSH_PENDING))
__mptcp_push_pending(sk, 0);
cond_resched();
--
2.30.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] mptcp: fix bit MPTCP_PUSH_PENDING tests
@ 2021-03-12 8:11 ` Matthieu Baerts
0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2021-03-12 8:11 UTC (permalink / raw)
To: Dan Carpenter
Cc: David S. Miller, Jakub Kicinski, netdev, mptcp, kernel-janitors,
Mat Martineau, Paolo Abeni
Hi Dan,
On 12/03/2021 08:41, Dan Carpenter wrote:
> The MPTCP_PUSH_PENDING define is 6 and these tests should be testing if
> BIT(6) is set.
Good catch, indeed, BIT() macro is missing!
It was not detected by our tests suite because in -net, that's the only
flag that is set.
But another patch for net-next is coming and another flag can be set as
well. What's funny is that this other flag is "9" which works well with
"6" because their bits are not overlapping :)
Anyway, better with "BIT()" macro!
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* [MPTCP] Re: [PATCH net] mptcp: fix bit MPTCP_PUSH_PENDING tests
@ 2021-03-12 8:11 ` Matthieu Baerts
0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2021-03-12 8:11 UTC (permalink / raw)
To: mptcp
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
Hi Dan,
On 12/03/2021 08:41, Dan Carpenter wrote:
> The MPTCP_PUSH_PENDING define is 6 and these tests should be testing if
> BIT(6) is set.
Good catch, indeed, BIT() macro is missing!
It was not detected by our tests suite because in -net, that's the only
flag that is set.
But another patch for net-next is coming and another flag can be set as
well. What's funny is that this other flag is "9" which works well with
"6" because their bits are not overlapping :)
Anyway, better with "BIT()" macro!
Reviewed-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-12 8:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-12 7:41 [PATCH net] mptcp: fix bit MPTCP_PUSH_PENDING tests Dan Carpenter
2021-03-12 7:41 ` [MPTCP] " Dan Carpenter
2021-03-12 8:11 ` Matthieu Baerts
2021-03-12 8:11 ` [MPTCP] " Matthieu Baerts
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.