From 644d3b6ec4afb5e9c0f35f48058d20f791806a9d Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Tue, 2 Aug 2016 16:52:42 -0400 Subject: [PATCH] revert: "LINUX: Fix oops during negative dentry caching" Commit fd23587a5dbc9a15e2b2e83160b947f045c92af1 was done to fix an oops when parent_vcache_dv() was called without the GLOCK held. Since the lockless code paths have been removed, and parent_vcache_dv() is always called with the GLOCK held, revert the extra locked flag argument and the calls obtain and release the GLOCK within parent_vcache_dv(). Change-Id: I21c3272ec4ed5d4fa1a746a0f783cccfc14e0c22 Reviewed-on: https://gerrit.openafs.org/12354 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/afs/LINUX/osi_vnodeops.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 8889587..db3efab 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1089,7 +1089,7 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta } static afs_uint32 -parent_vcache_dv(struct inode *inode, cred_t *credp, int locked) +parent_vcache_dv(struct inode *inode, cred_t *credp) { int free_cred = 0; struct vcache *pvcp; @@ -1104,9 +1104,6 @@ parent_vcache_dv(struct inode *inode, cred_t *credp, int locked) struct vrequest treq; struct afs_fakestat_state fakestate; - if (!locked) { - AFS_GLOCK(); - } if (!credp) { credp = crref(); free_cred = 1; @@ -1117,9 +1114,6 @@ parent_vcache_dv(struct inode *inode, cred_t *credp, int locked) if (free_cred) crfree(credp); afs_PutFakeStat(&fakestate); - if (!locked) { - AFS_GUNLOCK(); - } } return hgetlo(pvcp->f.m.DataVersion); } @@ -1214,7 +1208,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) parent = dget_parent(dp); pvcp = VTOAFS(parent->d_inode); - parent_dv = parent_vcache_dv(parent->d_inode, credp, 1); + parent_dv = parent_vcache_dv(parent->d_inode, credp); /* If the parent's DataVersion has changed or the vnode * is longer valid, we need to do a full lookup. VerifyVCache @@ -1298,7 +1292,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) parent = dget_parent(dp); pvcp = VTOAFS(parent->d_inode); - parent_dv = parent_vcache_dv(parent->d_inode, credp, 1); + parent_dv = parent_vcache_dv(parent->d_inode, credp); if (parent_dv > dp->d_time || !(pvcp->f.states & CStatd) || afs_IsDynroot(pvcp)) { @@ -1473,7 +1467,7 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode) #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) dp->d_op = &afs_dentry_operations; #endif - dp->d_time = parent_vcache_dv(dip, credp, 1); + dp->d_time = parent_vcache_dv(dip, credp); d_instantiate(dp, ip); } @@ -1541,7 +1535,7 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp) #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) dp->d_op = &afs_dentry_operations; #endif - dp->d_time = parent_vcache_dv(dip, credp, 1); + dp->d_time = parent_vcache_dv(dip, credp); AFS_GUNLOCK(); @@ -1770,7 +1764,7 @@ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) dp->d_op = &afs_dentry_operations; #endif - dp->d_time = parent_vcache_dv(dip, credp, 1); + dp->d_time = parent_vcache_dv(dip, credp); d_instantiate(dp, ip); } afs_DestroyAttr(vattr); -- 1.9.4