From: Chaskiel M Grundman Date: Thu, 1 Nov 2007 03:33:14 +0000 (+0000) Subject: STABLE14-linux-afs-unlinked-file-dentry-flagging-20071031 X-Git-Tag: openafs-stable-1_4_7pre1~187 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0e2179439e4888a676c298a287824aff2af29b79;p=packages%2Fo%2Fopenafs.git STABLE14-linux-afs-unlinked-file-dentry-flagging-20071031 fix case: perl -e 'open FOO, ">foo"; unlink(foo); @stat = stat(FOO); print "inode for foo(unlinked) is $stat[1]\n"; system("/bin/ls -ali | grep $stat[1]");' (cherry picked from commit c5678a4af78305cac2246480cc0c038655db324d) --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a9da75655..8b315558e 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -878,6 +878,15 @@ afs_dentry_iput(struct dentry *dp, struct inode *ip) AFS_GLOCK(); (void) afs_InactiveVCache(vcp, NULL); AFS_GUNLOCK(); +#ifdef DCACHE_NFSFS_RENAMED +#ifdef AFS_LINUX26_ENV + spin_lock(&dp->d_lock); +#endif + dp->d_flags &= ~DCACHE_NFSFS_RENAMED; +#ifdef AFS_LINUX26_ENV + spin_unlock(&dp->d_lock); +#endif +#endif iput(ip); } @@ -1095,6 +1104,15 @@ afs_linux_unlink(struct inode *dip, struct dentry *dp) } tvc->uncred = credp; tvc->states |= CUnlinked; +#ifdef DCACHE_NFSFS_RENAMED +#ifdef AFS_LINUX26_ENV + spin_lock(&dp->d_lock); +#endif + dp->d_flags |= DCACHE_NFSFS_RENAMED; +#ifdef AFS_LINUX26_ENV + spin_unlock(&dp->d_lock); +#endif +#endif } else { osi_FreeSmallSpace(__name); }