• NeilBrown's avatar
    nfsd: avoid races with wake_up_var() · 15392c8c
    NeilBrown authored
    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: default avatarNeilBrown <neilb@suse.de>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    15392c8c
nfs4state.c 232 KB