]> git.michaelhowe.org Git - packages/o/openafs.git/commit
afs: do not allow two shutdown sequences in parallel
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Tue, 29 Dec 2015 13:31:43 +0000 (10:31 -0300)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 5 Apr 2016 12:23:56 +0000 (08:23 -0400)
commit49a95f7c2bd550436e4bb2b7b4e9843315c0ebba
treeb8427451a9b6ad9e15940634c4a0a182f3b6ffba
parent18e761bdea76db32130e20598b8e3b310cf390c4
afs: do not allow two shutdown sequences in parallel

Often, ‘afsd -shutdown’ is called right after ‘umount’.
Both commands hold the glock before calling ‘afs_shutdown’.
However, one of the functions called by 'afs_shutdown', namely,
‘afs_FlushVCBs’, might drop the glock when the global
'afs_shuttingdown' is still equal to 0. As a result, a scenario
with two shutdown sequences proceeding in parallel is possible.

To fix the problem, the global ‘afs_shuttingdown’ is used as an
enumerated type to make sure that the second thread will not run
‘afs_shutdown’ while the first one is stuck inside ‘afs_FlushVCBs’.

Reviewed-on: http://gerrit.openafs.org/12016
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 70fd9bc6dcc79cb25e98cdcfd0f085c4bf4f310a)

Change-Id: I073d1914a7daa858a78305ff154074f2a51a9f5f
Reviewed-on: https://gerrit.openafs.org/12179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
24 files changed:
src/afs/AIX/osi_file.c
src/afs/DARWIN/osi_file.c
src/afs/DARWIN/osi_module.c
src/afs/FBSD/osi_file.c
src/afs/HPUX/osi_file.c
src/afs/HPUX/osi_vnodeops.c
src/afs/IRIX/osi_file.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_vnodeops.c
src/afs/LINUX24/osi_file.c
src/afs/LINUX24/osi_vnodeops.c
src/afs/NBSD/osi_file.c
src/afs/OBSD/osi_file.c
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_vnodeops.c
src/afs/UKERNEL/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_fid.c
src/afs/afs.h
src/afs/afs_call.c
src/afs/afs_osi_pag.c
src/afs/afs_pag_call.c
src/afs/afs_vcache.c
src/rx/SOLARIS/rx_knet.c