From 0e33eb5da8019bd8f50e2dba77c5a90c45ee5e81 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 6 Oct 2020 17:29:07 +0200 Subject: [PATCH] main: drop the ino if the last node is removed Signed-off-by: Giuseppe Scrivano --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.c b/main.c index d16755c..3f74933 100644 --- a/main.c +++ b/main.c @@ -951,6 +951,13 @@ drop_node_from_ino (Hash_table *inodes, struct ovl_node *node) ino = node->ino; + if (ino->lookups == 0) + { + hash_delete (inodes, ino); + inode_free (ino); + return; + } + /* If it is the only node referenced by the inode, do not destroy it. */ if (ino->node == node && node->next_link == NULL) return;