From 9bc7948f29bf00f0494ee8d49bfbf7427329544f Mon Sep 17 00:00:00 2001 From: "jeff.liu" Date: Mon, 8 Oct 2012 18:57:27 +0000 Subject: [PATCH] RDS: fix rds-ping spinlock recursion This is the revised patch for fixing rds-ping spinlock recursion according to Venkat's suggestions. RDS ping/pong over TCP feature has been broken for years(2.6.39 to 3.6.0) since we have to set TCP cork and call kernel_sendmsg() between ping/pong which both need to lock "struct sock *sk". However, this lock has already been hold before rds_tcp_data_ready() callback is triggerred. As a result, we always facing spinlock resursion which would resulting in system panic. Given that RDS ping is only used to test the connectivity and not for serious performance measurements, we can queue the pong transmit to rds_wq as a delayed response. Reported-by: Dan Carpenter CC: Venkat Venkatsubra CC: David S. Miller CC: James Morris Signed-off-by: Jie Liu Signed-off-by: David S. Miller (cherry picked from commit 5175a5e76bbdf20a614fb47ce7a38f0f39e70226) Signed-off-by: Jerry Snitselaar Conflicts: net/rds/send.c Orabug: 16223050 Signed-off-by: Jerry Snitselaar (cherry picked from commit 3badb20f7c232c2f72758453d01cb890ab686def) Signed-off-by: Jerry Snitselaar (cherry picked from commit bd05c6c016b911bb7d9a16f2998389b4219bb2cf) --- net/rds/send.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/rds/send.c b/net/rds/send.c index cf66b6797cdc..523d7c238a51 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1399,9 +1399,8 @@ rds_send_pong(struct rds_connection *conn, __be16 dport) rds_stats_inc(s_send_queued); rds_stats_inc(s_send_pong); - ret = rds_send_xmit(conn); - if (ret == -ENOMEM || ret == -EAGAIN) - queue_delayed_work(rds_wq, &conn->c_send_w, 1); + if (!test_bit(RDS_LL_SEND_FULL, &conn->c_flags)) + queue_delayed_work(rds_wq, &conn->c_send_w, 0); rds_message_put(rm); return 0; -- 2.50.1