From f9b4f9d63f5c62233a031a7e9d16fade235577eb Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 9 Aug 2017 20:06:03 -0500 Subject: [PATCH] SOLARIS: Fix vnode/vcache casts A few places were using vnodes and vcaches interchangeably. This is incorrect, since they may not always be the same thing if we stop embedding vnodes directly in vcaches Fix these to properly go through AFSTOV/VTOAFS to convert between vcaches and vnodes. Reviewed-on: https://gerrit.openafs.org/12695 Reviewed-by: Mark Vitale Reviewed-by: Cheyenne Wills Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk Tested-by: Mark Vitale (cherry picked from commit a6499e0b086d964f3fcc65fe4be31edc33015061) Change-Id: Ia6889966a7c595786f0a273b4c2a5a63fe60ddd3 Reviewed-on: https://gerrit.openafs.org/13527 Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Cheyenne Wills Reviewed-by: Mark Vitale Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/afs/SOLARIS/osi_vfsops.c | 8 ++++++-- src/afs/SOLARIS/osi_vnodeops.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 86e5f7803..cd127e44c 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -121,7 +121,7 @@ afs_unmount(struct vfs *afsp, int flag, afs_ucred_t *credp) * besides the caller of afs_unmount */ rootvp = afs_globalVp; afs_globalVp = NULL; - AFS_RELE(rootvp); + AFS_RELE(AFSTOV(rootvp)); } AFS_GUNLOCK(); @@ -254,7 +254,11 @@ afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) *avcp = NULL; if (!(code = afs_InitReq(&treq, credp))) { - code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); + struct vcache *tvc = NULL; + code = afs_osi_vget(&tvc, fidp, &treq); + if (tvc) { + *avcp = AFSTOV(tvc); + } } afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index fec1b457e..878a87b50 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -1433,7 +1433,7 @@ gafs_rename(struct vnode *odvp, char *aname1, vn_setpath(afs_globalVp, pvp, vp, aname2, strlen(aname2)); # endif /* !HAVE_VN_RENAMEPATH */ - AFS_RELE(avcp); + AFS_RELE(AFSTOV(avcp)); } } #endif -- 2.39.5