[OpenAFS-devel] pthreaded fileserver deadlocks on shutdown/restart

Rainer Toebbicke rtb@pclella.cern.ch
Thu, 30 Jan 2003 11:39:38 +0100


This is a multi-part message in MIME format.
--------------000603000604080107030406
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

The FSYNC_sync thread runs with no signals masked.

Consequently, whenever a SIGQUIT arrives (e.g. bos restart) it has a chance of 
catching it. If it does so while holding a lock such as the vol_glock_mutex 
just because a 'vos something' was going on resulting in e.g. VOffline_r being 
called, it'll call ShutDown() itself. Doing that it'll need the 
vol_glock_mutex again when doing VPrintCacheStats() and therefore block on the 
mutex held by itself.


Attached is a little patch to vol/fssync.c fixing this.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke        http://cern.ch/~rtb         rtb@mail.cern.ch  O__
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland   > |
Phone: +41 22 767 8985       Fax: +41 22 767 7155                     ( )\( )

--------------000603000604080107030406
Content-Type: application/x-java-vm;
 name="p_mask-signals-in-FSYNC"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="p_mask-signals-in-FSYNC"

KioqIG9wZW5hZnMvc3JjL3ZvbC9mc3N5bmMuYy5ub21hc2sJTW9uIEphbiAyNyAxNDo0NDo1
NSAyMDAzCi0tLSBvcGVuYWZzL3NyYy92b2wvZnNzeW5jLmMJVGh1IEphbiAzMCAxMDo1Njo0
NCAyMDAzCioqKioqKioqKioqKioqKgoqKiogMjE4LDIyNiAqKioqCi0tLSAyMTgsMjI5IC0t
LS0KICAjaWZkZWYgQUZTX1BUSFJFQURfRU5WCiAgICAgIHB0aHJlYWRfdCB0aWQ7CiAgICAg
IHB0aHJlYWRfYXR0cl90IHRhdHRyOworIAlBRlNfU0lHU0VUX0RFQ0w7CiAgICAgIGFzc2Vy
dChwdGhyZWFkX2F0dHJfaW5pdCgmdGF0dHIpID09IDApOwogICAgICBhc3NlcnQocHRocmVh
ZF9hdHRyX3NldGRldGFjaHN0YXRlKCZ0YXR0ciwgUFRIUkVBRF9DUkVBVEVfREVUQUNIRUQp
ID09IDApOworIAlBRlNfU0lHU0VUX0NMRUFSKCk7CiAgICAgIGFzc2VydChwdGhyZWFkX2Ny
ZWF0ZSgmdGlkLCAmdGF0dHIsIEZTWU5DX3N5bmMsIE5VTEwpID09IDApOworIAlBRlNfU0lH
U0VUX1JFU1RPUkUoKTsKICAjZWxzZSAvKiBBRlNfUFRIUkVBRF9FTlYgKi8KICAgICAgUFJP
Q0VTUyBwaWQ7CiAgICAgIGFzc2VydCAoTFdQX0NyZWF0ZVByb2Nlc3MoRlNZTkNfc3luYywg
VVNVQUxfU1RBQ0tfU0laRSwK
--------------000603000604080107030406--