summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
authorKinglong Mee <mijinlong@open-fs.com>2018-07-27 14:52:21 +0800
committerAmar Tumballi <amarts@redhat.com>2018-08-21 04:49:46 +0000
commitda7c26ff1bb879c6a9489c1dc42c7a3400c9be20 (patch)
treef211b73797064a4b1df91fcbeef8a714fec6ac19 /api/src/glfs-handleops.c
parent690ca8207269919e89341a9a49a3cff0e56e344b (diff)
gfapi: Use inode_forget in case of unlink/rename objects
After unlink/rename, the nonexistent inode should be remove from inode table, that's better than put to lru list. Change-Id: I5a40df188f3f42a2c864cfb4404b22b288fdcc12 fixes: bz#1612750 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
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);