Commit 501dcccd authored by Zach Brown's avatar Zach Brown Committed by Andy Grover

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: default avatarZach Brown <zach.brown@oracle.com>
parent 671202f3
...@@ -375,6 +375,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len, ...@@ -375,6 +375,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
struct rds_connection *conn; struct rds_connection *conn;
struct rds_message *rm; struct rds_message *rm;
unsigned int total = 0; unsigned int total = 0;
unsigned long flags;
size_t i; size_t i;
len /= sizeof(struct rds_info_message); len /= sizeof(struct rds_info_message);
...@@ -389,7 +390,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len, ...@@ -389,7 +390,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
else else
list = &conn->c_retrans; list = &conn->c_retrans;
spin_lock(&conn->c_lock); spin_lock_irqsave(&conn->c_lock, flags);
/* XXX too lazy to maintain counts.. */ /* XXX too lazy to maintain counts.. */
list_for_each_entry(rm, list, m_conn_item) { 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,7 +401,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len,
conn->c_faddr, 0); conn->c_faddr, 0);
} }
spin_unlock(&conn->c_lock); spin_unlock_irqrestore(&conn->c_lock, flags);
} }
} }
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment