Skip to content

Commit a6dcf6b

Browse files
Hakon-BuggeSomasundaram Krishnasamy
authored andcommitted
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. Orabug: 26842076 Signed-off-by: Håkon Bugge <[email protected]> Signed-off-by: David S. Miller <[email protected]> Reviewed-by: Knut Omang <[email protected]> Reviewed-by: Wei Lin Guay <[email protected]> Reviewed-by: Avinash Repaka <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Orabug: 27364391 (cherry picked from commit 1eb7d3d) cherry-pick-repo=linux-uek.git Signed-off-by: Gerd Rausch <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 53a713a commit a6dcf6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/rds/send.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
339339
len = ntohl(rm->m_inc.i_hdr.h_len);
340340
if (cp->cp_unacked_packets == 0 ||
341341
cp->cp_unacked_bytes < len) {
342-
__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
342+
set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
343343

344344
cp->cp_unacked_packets =
345345
rds_sysctl_max_unacked_packets;
@@ -988,7 +988,7 @@ static int rds_send_queue_rm(struct rds_sock *rs, struct rds_connection *conn,
988988
* throughput hits a certain threshold.
989989
*/
990990
if (rs->rs_snd_bytes >= rds_sk_sndbuf(rs) / 2)
991-
__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
991+
set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
992992

993993
list_add_tail(&rm->m_sock_item, &rs->rs_send_queue);
994994
set_bit(RDS_MSG_ON_SOCK, &rm->m_flags);

0 commit comments

Comments
 (0)