summaryrefslogtreecommitdiff
path: root/lib/fuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index a7feced..6d5df23 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -2967,6 +2967,20 @@ static void fuse_lib_unlink(fuse_req_t req, fuse_ino_t parent,
fuse_prepare_interrupt(f, req, &d);
if (!f->conf.hard_remove && is_open(f, parent, name)) {
err = hide_node(f, path, parent, name);
+ if (!err) {
+ /* we have hidden the node so now check again under a lock in case it is not used any more */
+ if (!is_open(f, parent, wnode->name)) {
+ char *unlinkpath;
+
+ /* get the hidden file path, to unlink it */
+ if (try_get_path(f, wnode->nodeid, NULL, &unlinkpath, NULL, false) == 0) {
+ err = fuse_fs_unlink(f->fs, unlinkpath);
+ if (!err)
+ remove_node(f, parent, wnode->name);
+ free(unlinkpath);
+ }
+ }
+ }
} else {
err = fuse_fs_unlink(f->fs, path);
if (!err)