mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
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:
parent
81e03e005a
commit
165bd14126
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user