]> git.neil.brown.name Git - history.git/commit
[PATCH] kNFSd: Fix deadlock problem in lockd.
authorNeil Brown <neilb@cse.unsw.edu.au>
Fri, 14 Mar 2003 10:11:42 +0000 (02:11 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 14 Mar 2003 10:11:42 +0000 (02:11 -0800)
commit789d95e669710036adc1734938e57ceb3b3d46bb
treeeb6a49a118a7dcb56ed3d3ce1d99c94dfa72d698
parent7cb09575b27bd76531b414a947617c0090edc0d8
[PATCH] kNFSd: Fix deadlock problem in lockd.

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.
fs/lockd/svclock.c