diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 2b26c2be72..9ebbfe1e50 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -735,8 +735,12 @@ static inline void check_bad_parent(struct dentry *dp) { cred_t *credp; - struct vcache *vcp = VTOAFS(dp->d_inode), *avc = NULL; - struct vcache *pvc = VTOAFS(dp->d_parent->d_inode); + struct dentry *parent; + struct vcache *vcp, *pvc, *avc = NULL; + + vcp = VTOAFS(dp->d_inode); + parent = dget_parent(dp); + pvc = VTOAFS(parent->d_inode); if (vcp->mvid->Fid.Volume != pvc->f.fid.Fid.Volume) { /* bad parent */ credp = crref(); @@ -754,6 +758,8 @@ check_bad_parent(struct dentry *dp) crfree(credp); } + dput(parent); + return; }