From b51cadd464887b8607b61d9ee6493bb344474840 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 29 Jul 2011 16:44:11 -0500 Subject: [PATCH] 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. Reviewed-on: http://gerrit.openafs.org/5117 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit b621a2986099488426a026818532a9600db9aeba) Change-Id: Iaa5db97e9fc87d1eb083d20a9fc6a49cbb5a066b Reviewed-on: http://gerrit.openafs.org/5230 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/SOLARIS/osi_vfsops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 254c9acf8..9207914cd 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -128,11 +128,13 @@ afs_unmount(struct vfs *afsp, afs_ucred_t *credp) afsp->vfs_flag |= VFS_UNMOUNTED; #endif /* AFS_SUN58_ENV */ - /* 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); + } #ifndef AFS_SUN58_ENV /* shutdown now, since gafs_freevfs() will not be called */ -- 2.39.5