]> git.michaelhowe.org Git - packages/o/openafs.git/commit
libafs: Do not write-lock afs_xserver on ICBS
authorAndrew Deason <adeason@sinenomine.net>
Tue, 10 May 2011 17:54:53 +0000 (12:54 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 17 May 2011 14:45:53 +0000 (07:45 -0700)
commitadfe378df858aef951b0a30b640e46ad1feefb2d
treed4f6b90a004b061c5070f28fe2fba633e466b441
parent699c407bfbf0fad2667b231a1e73cdf1a0aec7b0
libafs: Do not write-lock afs_xserver on ICBS

Our RXAFSCB_InitCallBackState* handler currently write-locks
afs_xserver when it clears the SCAPS_KNOWN flag for the relevant
server. However, the afs_xserver lock is for protecting the global
list and hash table of server structures, and is not necessary to
acquire in order to modify the flags of an individual server struct.
For instance, CkSrv_GetCaps does not acquire any locks to modify the
server flags.

Taking this lock conflicts with a read lock on afs_xserver acquired by
afs_FlushVCBs when it traverses the list of server structures.
afs_FlushVCBs may contact a server that then calls InitCallBackState
on us, causing a deadlock if ICBS waits for the afs_xserver lock.

So, avoid locking afs_xserver in this case, to avoid that deadlock.

Reviewed-on: http://gerrit.openafs.org/4639
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ae638fa383b8270fe2461a2ad91b9101c74f3593)

Change-Id: I095c74f51f1ddb74ebaecda221ca45a4f6ad09c8
Reviewed-on: http://gerrit.openafs.org/4663
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_callback.c