summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index e40adf04d3d..343fc384ddf 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1794,11 +1794,16 @@ pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
ret = syncop_rename (subvol, &oldloc, &newloc, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
- if (ret == 0)
+ if (ret == 0) {
inode_rename (oldloc.parent->table, oldloc.parent, oldloc.name,
newloc.parent, newloc.name, oldloc.inode,
&oldiatt);
+ if (newloc.inode && !inode_has_dentry (newloc.inode))
+ inode_forget (newloc.inode, 0);
+
+ }
+
out:
loc_wipe (&oldloc);
loc_wipe (&newloc);