From: Andrew Deason Date: Fri, 29 Jul 2011 21:44:11 +0000 (-0500) Subject: SOLARIS: Do not release NULL root vp on unmount X-Git-Tag: upstream/1.8.0_pre1^2~3456 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b621a2986099488426a026818532a9600db9aeba;p=packages%2Fo%2Fopenafs.git SOLARIS: Do not release NULL root vp on unmount When we unmount, and afs_globalVp is NULL (e.g. because root.afs was unavailable when the client was started), we will panic the machine if we try to release it. So, if afs_globalVp is NULL when we hit our unmount handler, don't touch it. Reported by Andy Cobaugh. Change-Id: I4e5869237e24da320afc2b7edaf8edca0ab3e4e9 Reviewed-on: http://gerrit.openafs.org/5117 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 7d69c34d7..49f53bcc9 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -119,11 +119,13 @@ afs_unmount(struct vfs *afsp, int flag, afs_ucred_t *credp) afsp->vfs_flag |= VFS_UNMOUNTED; - /* release the root vnode, which should be the last reference to us - * besides the caller of afs_unmount */ - rootvp = afs_globalVp; - afs_globalVp = NULL; - AFS_RELE(rootvp); + if (afs_globalVp) { + /* release the root vnode, which should be the last reference to us + * besides the caller of afs_unmount */ + rootvp = afs_globalVp; + afs_globalVp = NULL; + AFS_RELE(rootvp); + } AFS_GUNLOCK(); return 0;