aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_recv.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2022-08-10 09:00:42 -0400
committerDavid S. Miller <davem@davemloft.net>2022-08-12 10:46:01 +0100
commit9f414eb409daf4f778f011cf8266d36896bb930b (patch)
tree7cfe718f6051784b6098b114be7f00db6d34dbad /net/rds/ib_recv.c
parentMerge tag 'net-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
downloadlinux-dev-9f414eb409daf4f778f011cf8266d36896bb930b.tar.xz
linux-dev-9f414eb409daf4f778f011cf8266d36896bb930b.zip
rds: add missing barrier to release_refill
The functions clear_bit and set_bit do not imply a memory barrier, thus it may be possible that the waitqueue_active function (which does not take any locks) is moved before clear_bit and it could miss a wakeup event. Fix this bug by adding a memory barrier after clear_bit. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/ib_recv.c')
-rw-r--r--net/rds/ib_recv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 6fdedd9dbbc2..cfbf0e129cba 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -363,6 +363,7 @@ static int acquire_refill(struct rds_connection *conn)
static void release_refill(struct rds_connection *conn)
{
clear_bit(RDS_RECV_REFILL, &conn->c_flags);
+ smp_mb__after_atomic();
/* We don't use wait_on_bit()/wake_up_bit() because our waking is in a
* hot path and finding waiters is very rare. We don't want to walk