diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index b97318645b..866d3fc57b 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -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; } diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 6543efde72..83a5ab0e66 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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);