• Neil Brown's avatar
    [PATCH] kNFSd: Fix deadlock problem in lockd. · 789d95e6
    Neil Brown authored
    nlmsvc_lock calls nlmsvc_create_block with file->f_sema
    held.
    nlmsvc_create_block calls nlmclnt_lookup_host which might
    call nlm_gc_hosts which might, eventually, try to claim
    file->f_sema for the same file -> deadlock.
    
    nlmsvc_create_block does not need any protection under
    any lock as lockd is single-threaded and _create_block
    only plays with internal data structures.
    
    So we release the f_sema before calling in, and make sure
    it gets claimed again afterwards.
    789d95e6
svclock.c 17.7 KB