diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 17eb4c21d1..484376d1b6 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -329,7 +329,7 @@ void osi_linux_free_inode_pages(void) void osi_clear_inode(struct inode *ip) { cred_t *credp = crref(); - struct vcache *vc = ITOAFS(ip); + struct vcache *vcp = ITOAFS(ip); #if defined(AFS_LINUX24_ENV) if (atomic_read(&ip->i_count) > 1) @@ -338,15 +338,15 @@ void osi_clear_inode(struct inode *ip) #endif printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip); - ObtainWriteLock(&vc->lock, 504); - afs_InactiveVCache(vc, credp); - ReleaseWriteLock(&vc->lock); + afs_InactiveVCache(vcp, credp); + ObtainWriteLock(&vcp->lock, 504); #if defined(AFS_LINUX24_ENV) atomic_set(&ip->i_count, 0); #else ip->i_count = 0; #endif ip->i_nlink = 0; /* iput checks this after calling this routine. */ + ReleaseWriteLock(&vcp->lock); crfree(credp); } diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 7879e82bd4..2bb449f9f8 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -920,10 +920,22 @@ static void afs_dentry_iput(struct dentry *dp, struct inode *ip) osi_iput(ip); } +static int afs_dentry_delete(struct dentry *dp) +{ + if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked)) + return 1; /* bad inode? */ + + afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, + dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name, + ICL_TYPE_STRING, dp->d_name.name); + return 0; +} + #if defined(AFS_LINUX24_ENV) struct dentry_operations afs_dentry_operations = { d_revalidate: afs_linux_dentry_revalidate, d_iput: afs_dentry_iput, + d_delete: afs_dentry_delete, }; struct dentry_operations *afs_dops = &afs_dentry_operations; #else @@ -1086,7 +1098,6 @@ int afs_linux_unlink(struct inode *dip, struct dentry *dp) int code; cred_t *credp = crref(); const char *name = dp->d_name.name; - int putback = 0; AFS_GLOCK(); code = afs_remove(ITOAFS(dip), name, credp); diff --git a/src/afs/afs_trace.et b/src/afs/afs_trace.et index 01f779b310..0d1decf076 100644 --- a/src/afs/afs_trace.et +++ b/src/afs/afs_trace.et @@ -156,6 +156,8 @@ error_table 2 ZCM ec CM_TRACE_DCACHEWAIT, "%s line %d: sleeping or waiting for 0x%x flags 0x%x" ec CM_TRACE_VNODEREAD, "UFSRead: tdc 0x%x, offset (0x%x, 0x%x) len (0x%x 0x%x)" ec CM_TRACE_SLEEP, "Sleep: evp 0x%x, count %d seq 0x%x evp->seq 0x%x" - ec CM_TRACE_WAKE, "Wapeup: evp 0x%x, evp->seq 0x%x" + ec CM_TRACE_WAKE, "Wakeup: evp 0x%x, evp->seq 0x%x" + ec CM_TRACE_DENTRYDELETE, "dentry_delete inode 0x%x d_name %s/%s" + ec CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren tvc 0x%x" end