main: drop the ino if the last node is removed

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-10-06 17:29:07 +02:00
parent 228544e71d
commit 0e33eb5da8
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

7
main.c
View File

@ -951,6 +951,13 @@ drop_node_from_ino (Hash_table *inodes, struct ovl_node *node)
ino = node->ino; 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 it is the only node referenced by the inode, do not destroy it. */
if (ino->node == node && node->next_link == NULL) if (ino->node == node && node->next_link == NULL)
return; return;