Linux : Apply more dget_parent() pixie dust

Replace another dentry->d_parent->d_inode lookup with a dget_parent()
- accessing d_parent directly is potentially racy.

Change-Id: I2c21cd6ef5c1b4b601c830836590705b397915e4
Reviewed-on: http://gerrit.openafs.org/1647
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2010-03-24 16:48:35 +00:00 committed by Derrick Brashear
parent 81e03e005a
commit 165bd14126

View File

@ -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;
}