Linux: Check for multiple silly renames

We don't want to do multiple silly renames of the same dcache entry,
so add a check for that occuring, and just return EBUSY if we're
trying to do so.

Change-Id: Ic1cb4061d89bf87926995162f1ac410375bddcb5
Reviewed-on: http://gerrit.openafs.org/1035
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2009-12-27 11:28:43 +00:00 committed by Derrick Brashear
parent ec352e0bfd
commit e4708157ea
2 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,12 @@ afs_linux_set_nfsfs_renamed(struct dentry *dp) {
dp->d_flags |= DCACHE_NFSFS_RENAMED;
spin_unlock(&dp->d_lock);
}
static inline int
afs_linux_nfsfs_renamed(struct dentry *dp) {
return dp->d_flags & DCACHE_NFSFS_RENAMED;
}
#else
static inline void afs_linux_clear_nfsfs_renamed(void) { return; }
static inline void afs_linux_set_nfsfs_renamed(void) { return; }

View File

@ -1130,6 +1130,9 @@ afs_linux_sillyrename(struct inode *dir, struct dentry *dentry,
char *__name = NULL;
int code;
if (afs_linux_nfsfs_renamed(dentry))
return EBUSY;
do {
dput(__dp);