public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len
@ 2026-02-10 17:09 Allison Henderson
  2026-02-12 18:09 ` Simon Horman
  2026-02-13  3:05 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Allison Henderson @ 2026-02-10 17:09 UTC (permalink / raw)
  To: netdev
  Cc: linux-kselftest, pabeni, edumazet, rds-devel, kuba, horms,
	linux-rdma, allison.henderson

Commit 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with
connection teardown") modifies rds_sendmsg to avoid enqueueing work
while a tear down is in progress. However, it also changed the return
value of rds_sendmsg to that of rds_send_xmit instead of the
payload_len. This means the user may incorrectly receive errno values
when it should have simply received a payload of 0 while the peer
attempts a reconnections.  So this patch corrects the teardown handling
code to only use the out error path in that case, thus restoring the
original payload_len return value.

Fixes: 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with connection teardown")
Signed-off-by: Allison Henderson <achender@kernel.org>

---
Changes in v2:
- Rebased on net/main to fix apply failure in v1

Signed-off-by: Allison Henderson <achender@kernel.org>
---
 net/rds/send.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index 0b3d0ef2f008..071c5dca969a 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1382,9 +1382,11 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
 		else
 			queue_delayed_work(rds_wq, &cpath->cp_send_w, 1);
 		rcu_read_unlock();
+
+		if (ret)
+			goto out;
 	}
-	if (ret)
-		goto out;
+
 	rds_message_put(rm);
 
 	for (ind = 0; ind < vct.indx; ind++)
-- 
2.43.0


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

* Re: [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len
  2026-02-10 17:09 [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len Allison Henderson
@ 2026-02-12 18:09 ` Simon Horman
  2026-02-13  3:05 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2026-02-12 18:09 UTC (permalink / raw)
  To: Allison Henderson
  Cc: netdev, linux-kselftest, pabeni, edumazet, rds-devel, kuba,
	linux-rdma, allison.henderson

On Tue, Feb 10, 2026 at 10:09:52AM -0700, Allison Henderson wrote:
> Commit 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with
> connection teardown") modifies rds_sendmsg to avoid enqueueing work
> while a tear down is in progress. However, it also changed the return
> value of rds_sendmsg to that of rds_send_xmit instead of the
> payload_len. This means the user may incorrectly receive errno values
> when it should have simply received a payload of 0 while the peer
> attempts a reconnections.  So this patch corrects the teardown handling
> code to only use the out error path in that case, thus restoring the
> original payload_len return value.
> 
> Fixes: 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with connection teardown")
> Signed-off-by: Allison Henderson <achender@kernel.org>
> 
> ---
> Changes in v2:
> - Rebased on net/main to fix apply failure in v1

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len
  2026-02-10 17:09 [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len Allison Henderson
  2026-02-12 18:09 ` Simon Horman
@ 2026-02-13  3:05 ` Jakub Kicinski
  2026-02-13  6:39   ` Allison Henderson
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2026-02-13  3:05 UTC (permalink / raw)
  To: Allison Henderson
  Cc: netdev, linux-kselftest, pabeni, edumazet, rds-devel, horms,
	linux-rdma, allison.henderson

On Tue, 10 Feb 2026 10:09:52 -0700 Allison Henderson wrote:
> Commit 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with
> connection teardown") modifies rds_sendmsg to avoid enqueueing work
> while a tear down is in progress. However, it also changed the return
> value of rds_sendmsg to that of rds_send_xmit instead of the
> payload_len. This means the user may incorrectly receive errno values
> when it should have simply received a payload of 0 while the peer
> attempts a reconnections.  So this patch corrects the teardown handling
> code to only use the out error path in that case, thus restoring the
> original payload_len return value.

net-next now became net so this no longer applies.
Please rebase?
-- 
pw-bot: cr

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

* Re: [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len
  2026-02-13  3:05 ` Jakub Kicinski
@ 2026-02-13  6:39   ` Allison Henderson
  0 siblings, 0 replies; 4+ messages in thread
From: Allison Henderson @ 2026-02-13  6:39 UTC (permalink / raw)
  To: kuba@kernel.org, achender@kernel.org
  Cc: linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
	horms@kernel.org, edumazet@google.com, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, pabeni@redhat.com

On Thu, 2026-02-12 at 19:05 -0800, Jakub Kicinski wrote:
> On Tue, 10 Feb 2026 10:09:52 -0700 Allison Henderson wrote:
> > Commit 3db6e0d172c9 ("rds: use RCU to synchronize work-enqueue with
> > connection teardown") modifies rds_sendmsg to avoid enqueueing work
> > while a tear down is in progress. However, it also changed the return
> > value of rds_sendmsg to that of rds_send_xmit instead of the
> > payload_len. This means the user may incorrectly receive errno values
> > when it should have simply received a payload of 0 while the peer
> > attempts a reconnections.  So this patch corrects the teardown handling
> > code to only use the out error path in that case, thus restoring the
> > original payload_len return value.
> 
> net-next now became net so this no longer applies.
> Please rebase?

Sure, I've sent a rebased v3.

Thank you
Allison


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

end of thread, other threads:[~2026-02-13  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 17:09 [PATCH net v2] net/rds: rds_sendmsg should not discard payload_len Allison Henderson
2026-02-12 18:09 ` Simon Horman
2026-02-13  3:05 ` Jakub Kicinski
2026-02-13  6:39   ` Allison Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox