summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAllison Henderson2026-02-12 20:54:09 -0700
committerSasha Levin2026-03-04 07:20:05 -0500
commitd01e69733a94aba9a3143ea250a8748eb4d92c61 (patch)
tree96a06e772ee0ea17fc8b65278326bed77a988a81 /net
parentce66d6786de45b7ed9cbbdc0988054bf09e58f54 (diff)
net/rds: rds_sendmsg should not discard payload_len
[ Upstream commit da29e453dcb3aa7cabead7915f5f945d0add3a52 ] 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") Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Allison Henderson <achender@kernel.org> Link: https://patch.msgid.link/20260213035409.1963391-1-achender@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/rds/send.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rds/send.c b/net/rds/send.c
index 0005fb43f2df..8aa06f7e4640 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1383,9 +1383,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++)