Commit f530f39f authored by Håkon Bugge's avatar Håkon Bugge Committed by David S. Miller

rds: Fix non-atomic operation on shared flag variable

The bits in m_flags in struct rds_message are used for a plurality of
reasons, and from different contexts. To avoid any missing updates to
m_flags, use the atomic set_bit() instead of the non-atomic equivalent.
Signed-off-by: default avatarHåkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: default avatarKnut Omang <knut.omang@oracle.com>
Reviewed-by: default avatarWei Lin Guay <wei.lin.guay@oracle.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c8468dc
...@@ -273,7 +273,7 @@ int rds_send_xmit(struct rds_conn_path *cp) ...@@ -273,7 +273,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
len = ntohl(rm->m_inc.i_hdr.h_len); len = ntohl(rm->m_inc.i_hdr.h_len);
if (cp->cp_unacked_packets == 0 || if (cp->cp_unacked_packets == 0 ||
cp->cp_unacked_bytes < len) { cp->cp_unacked_bytes < len) {
__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags); set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
cp->cp_unacked_packets = cp->cp_unacked_packets =
rds_sysctl_max_unacked_packets; rds_sysctl_max_unacked_packets;
...@@ -829,7 +829,7 @@ static int rds_send_queue_rm(struct rds_sock *rs, struct rds_connection *conn, ...@@ -829,7 +829,7 @@ static int rds_send_queue_rm(struct rds_sock *rs, struct rds_connection *conn,
* throughput hits a certain threshold. * throughput hits a certain threshold.
*/ */
if (rs->rs_snd_bytes >= rds_sk_sndbuf(rs) / 2) if (rs->rs_snd_bytes >= rds_sk_sndbuf(rs) / 2)
__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags); set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
list_add_tail(&rm->m_sock_item, &rs->rs_send_queue); list_add_tail(&rm->m_sock_item, &rs->rs_send_queue);
set_bit(RDS_MSG_ON_SOCK, &rm->m_flags); set_bit(RDS_MSG_ON_SOCK, &rm->m_flags);
......
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