aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/connection.c
diff options
context:
space:
mode:
authorZach Brown <zach.brown@oracle.com>2010-06-04 17:25:27 -0400
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:15:26 -0400
commit501dcccdb7a2335cde07d4acb56e636182d62944 (patch)
treee2079f8d22c498e6c7f1fcfa326e123b4945df7b /net/rds/connection.c
parent671202f3491cccdb267f88ad59ba0635aeb2a22e (diff)
rds: block ints when acquiring c_lock in rds_conn_message_info()
conn->c_lock is acquired in interrupt context. rds_conn_message_info() is called from user context and was acquiring c_lock without blocking interrupts, leading to possible deadlocks. Signed-off-by: Zach Brown <zach.brown@oracle.com>
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r--net/rds/connection.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 5bd96d538fb9..5bb0eec5ada3 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -375,6 +375,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
375 struct rds_connection *conn; 375 struct rds_connection *conn;
376 struct rds_message *rm; 376 struct rds_message *rm;
377 unsigned int total = 0; 377 unsigned int total = 0;
378 unsigned long flags;
378 size_t i; 379 size_t i;
379 380
380 len /= sizeof(struct rds_info_message); 381 len /= sizeof(struct rds_info_message);
@@ -389,7 +390,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
389 else 390 else
390 list = &conn->c_retrans; 391 list = &conn->c_retrans;
391 392
392 spin_lock(&conn->c_lock); 393 spin_lock_irqsave(&conn->c_lock, flags);
393 394
394 /* XXX too lazy to maintain counts.. */ 395 /* XXX too lazy to maintain counts.. */
395 list_for_each_entry(rm, list, m_conn_item) { 396 list_for_each_entry(rm, list, m_conn_item) {
@@ -400,7 +401,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
400 conn->c_faddr, 0); 401 conn->c_faddr, 0);
401 } 402 }
402 403
403 spin_unlock(&conn->c_lock); 404 spin_unlock_irqrestore(&conn->c_lock, flags);
404 } 405 }
405 } 406 }
406 rcu_read_unlock(); 407 rcu_read_unlock();