mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds
@ 2022-07-25 20:52 Mat Martineau
  2022-07-25 22:51 ` mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results MPTCP CI
  2022-07-27  3:10 ` [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Mat Martineau @ 2022-07-25 20:52 UTC (permalink / raw)
  To: netdev
  Cc: Mat Martineau, davem, kuba, pabeni, edumazet, matthieu.baerts, fw, mptcp

New subflows are created within the kernel using O_NONBLOCK, so
EINPROGRESS is the expected return value from kernel_connect().
__mptcp_subflow_connect() has the correct logic to consider EINPROGRESS
to be a successful case, but it has also used that error code as its
return value.

Before v5.19 this was benign: all the callers ignored the return
value. Starting in v5.19 there is a MPTCP_PM_CMD_SUBFLOW_CREATE generic
netlink command that does use the return value, so the EINPROGRESS gets
propagated to userspace.

Make __mptcp_subflow_connect() always return 0 on success instead.

Fixes: ec3edaa7ca6c ("mptcp: Add handling of outgoing MP_JOIN requests")
Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment")
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---

Note: The original author of ec3edaa7ca6c is no longer reachable at that
email address.

---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 63e8892ec807..af28f3b60389 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1533,7 +1533,7 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc,
 	mptcp_sock_graft(ssk, sk->sk_socket);
 	iput(SOCK_INODE(sf));
 	WRITE_ONCE(msk->allow_infinite_fallback, false);
-	return err;
+	return 0;
 
 failed_unlink:
 	list_del(&subflow->node);

base-commit: 9af0620de1e118666881376f6497d1785758b04c
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results
  2022-07-25 20:52 [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds Mat Martineau
@ 2022-07-25 22:51 ` MPTCP CI
  2022-07-27  3:10 ` [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: MPTCP CI @ 2022-07-25 22:51 UTC (permalink / raw)
  To: Mat Martineau; +Cc: mptcp

Hi Mat,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal:
  - Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
  - Task: https://cirrus-ci.com/task/5587014698401792
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5587014698401792/summary/summary.txt

- KVM Validation: debug:
  - Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
  - Task: https://cirrus-ci.com/task/5503009298841600
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5503009298841600/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/22f5cd0965a5


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds
  2022-07-25 20:52 [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds Mat Martineau
  2022-07-25 22:51 ` mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results MPTCP CI
@ 2022-07-27  3:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-27  3:10 UTC (permalink / raw)
  To: Mat Martineau
  Cc: netdev, davem, kuba, pabeni, edumazet, matthieu.baerts, fw, mptcp

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 25 Jul 2022 13:52:31 -0700 you wrote:
> New subflows are created within the kernel using O_NONBLOCK, so
> EINPROGRESS is the expected return value from kernel_connect().
> __mptcp_subflow_connect() has the correct logic to consider EINPROGRESS
> to be a successful case, but it has also used that error code as its
> return value.
> 
> Before v5.19 this was benign: all the callers ignored the return
> value. Starting in v5.19 there is a MPTCP_PM_CMD_SUBFLOW_CREATE generic
> netlink command that does use the return value, so the EINPROGRESS gets
> propagated to userspace.
> 
> [...]

Here is the summary with links:
  - [net] mptcp: Do not return EINPROGRESS when subflow creation succeeds
    https://git.kernel.org/netdev/net/c/b5177ed92bf6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-27  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 20:52 [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds Mat Martineau
2022-07-25 22:51 ` mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results MPTCP CI
2022-07-27  3:10 ` [PATCH net] mptcp: Do not return EINPROGRESS when subflow creation succeeds patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).