Prevent deadlock if fs_stateSave panics
fs_stateSave can call ShutDownAndCore(PANIC) if it detects host list
corruption. Right now this will deadlock the shutdown thread, since
we're still holding a read lock on the FS state when we do so, and
ShutDownAndCore will attempt to acquire a write lock. Do two things to
make this a bit better:
-- Unlock the FS state before calling fs_stateSave, sine we're no
longer looking at the FS state (the 'state' in fs_stateSave refers to
the host list and callback lists, not the state locked by
FS_STATE_*LOCK)
-- If ShutDownAndCore detects that it was called inside of
ShutDownAndCore, skip shutting down the volume and host packages, since
they have already been shut down
Change-Id: I24a994ff85a6d866a5800b777c0cf5ab2ba466e4
Reviewed-on: http://gerrit.openafs.org/1362
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>