diff options
author | NeilBrown <neilb@suse.de> | 2024-08-30 10:03:17 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-09-21 02:31:03 +0300 |
commit | 15392c8cd13449bf0c09faf8e78ca2fdfb023284 (patch) | |
tree | c2fc3be707862bd648d5456c3eafecfb8adb5305 /rust/helpers/build_bug.c | |
parent | 985eeae9c874157bb8ece9060020856f68aa08d5 (diff) | |
download | linux-15392c8cd13449bf0c09faf8e78ca2fdfb023284.tar.xz |
nfsd: avoid races with wake_up_var()
wake_up_var() needs a barrier after the important change is made in the
var and before wake_up_var() is called, else it is possible that a wake
up won't be sent when it should.
In each case here the var is changed in an "atomic" manner, so
smb_mb__after_atomic() is sufficient.
In one case the important change (removing the lease) is performed
*after* the wake_up, which is backwards. The code survives in part
because the wait_var_event is given a timeout.
This patch adds the required barriers and calls destroy_delegation()
*before* waking any threads waiting for the delegation to be destroyed.
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions