Commit 15392c8
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>1 parent 985eeae commit 15392c8
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4706 | 4706 | | |
4707 | 4707 | | |
4708 | 4708 | | |
| 4709 | + | |
4709 | 4710 | | |
4710 | 4711 | | |
4711 | 4712 | | |
| |||
5006 | 5007 | | |
5007 | 5008 | | |
5008 | 5009 | | |
| 5010 | + | |
5009 | 5011 | | |
5010 | 5012 | | |
5011 | 5013 | | |
| |||
7475 | 7477 | | |
7476 | 7478 | | |
7477 | 7479 | | |
7478 | | - | |
7479 | 7480 | | |
| 7481 | + | |
| 7482 | + | |
7480 | 7483 | | |
7481 | 7484 | | |
7482 | 7485 | | |
| |||
0 commit comments