Commit 037afca5 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Unlink remaining children inodes when deleting the parent.

parent a4e8f4dc
......@@ -438,6 +438,7 @@ static void inode_set_name( struct inode *inode, const char *name )
static void free_inode( struct inode *inode )
{
int subtree = 0, watches = 0;
struct inode *tmp, *next;
struct dir *dir;
LIST_FOR_EACH_ENTRY( dir, &inode->dirs, struct dir, in_entry )
......@@ -448,7 +449,6 @@ static void free_inode( struct inode *inode )
if (!subtree && !inode->parent)
{
struct inode *tmp, *next;
LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &inode->children,
struct inode, ch_entry )
{
......@@ -464,6 +464,13 @@ static void free_inode( struct inode *inode )
if (inode->parent)
list_remove( &inode->ch_entry );
/* disconnect remaining children from the parent */
LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &inode->children, struct inode, ch_entry )
{
list_remove( &tmp->ch_entry );
tmp->parent = NULL;
}
if (inode->wd != -1)
{
inotify_remove_watch( get_unix_fd( inotify_fd ), inode->wd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment