Skip to contentSkip to conversation

mptcp: fix bit MPTCP_PUSH_PENDING tests

PATCH In review Dan Carpenter 3 participants 3 messages Mar 12, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: fix bit MPTCP_PUSH_PENDING tests

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(-)
net/mptcp/protocol.c +2 -2
index 76958570ae7f..1590b9d4cde2 100644
@@ -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();
Signature · 1 line
2.30.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 2 lines · Dan Carpenter

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

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
#2 lore raw
In reply to Dan Carpenter

(MPTCP ML only)

Quoted 5 lines · Dan Carpenter

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>

This patch is now in our tree:

- fe202ab685d5: mptcp: fix bit MPTCP_PUSH_PENDING tests
- 09d2582abdb4: conflict in t/mptcp-clean-up-the-rtx-path
- Results: c1ab0a28e2b1..932a56a08a15

Tests + export are in progress!

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net