rds: add missing barrier to release_refill
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 10 Aug 2022 13:00:42 +0000 (09:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:39:54 +0000 (11:39 +0200)
commit852f6a784a4b2cd4292f54e7d72c1cc647db50a8
tree4d3c427d07ad0fc426baad7484ead0d66455dc8c
parentd26beb910904993fdc8c8dbb610908b2c066b6a6
rds: add missing barrier to release_refill

commit 9f414eb409daf4f778f011cf8266d36896bb930b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rds/ib_recv.c