Index: trunk/kernel/fs/vfs.c
===================================================================
--- trunk/kernel/fs/vfs.c	(revision 629)
+++ trunk/kernel/fs/vfs.c	(revision 630)
@@ -2915,5 +2915,5 @@
     fs_type    = hal_remote_l32( XPTR( child_cxy , &ctx_ptr->type ) );
 
-    //////////////////////////// create <.> 
+    //////////////////////////// create <.> dentry //////////////////////
     if( child_cxy == local_cxy )     
     {
@@ -2941,7 +2941,8 @@
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] created dentry <.> (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, child_cxy, dentry_ptr );
+printk("\n[%s] thread[%x,%x] created dentry <.> (%x,%x) / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, child_cxy, dentry_ptr, cycle );
 #endif
 
@@ -2969,36 +2970,43 @@
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry <.> to parent and child inodes\n", 
-__FUNCTION__, this->process->pid, this->trdid ); 
+printk("\n[%s] thread[%x,%x] linked dentry <.> to parent and child inodes / cycle %d\n", 
+__FUNCTION__, this->process->pid, this->trdid, cycle ); 
 #endif
 
     // introduce <.> dentry into child directory mapper
-    if( child_cxy == local_cxy )
-    { 
-        error = vfs_fs_add_dentry( child_ptr,
-                                   dentry_ptr );
-    }
-    else
-    {
-        rpc_vfs_fs_add_dentry_client( child_cxy,
-                                      child_ptr,
-                                      dentry_ptr,
-                                      &error );
-    }
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot introduce dentry <..> in mapper %x\n",
-        __FUNCTION__ );
-        return -1;
-    }
+    // only if the target directory is not the root VFS
+    if( child_xp != parent_xp )
+    {
+        if( child_cxy == local_cxy )
+        { 
+            error = vfs_fs_add_dentry( child_ptr,
+                                       dentry_ptr );
+        }
+        else
+        {
+            rpc_vfs_fs_add_dentry_client( child_cxy,
+                                          child_ptr,
+                                          dentry_ptr,
+                                          &error );
+        }
+        if( error )
+        {
+            printk("\n[ERROR] in %s : cannot introduce dentry <..> in mapper %x\n",
+            __FUNCTION__ );
+            return -1;
+        }
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] registered dentry <.> in child mapper\n", 
-__FUNCTION__, this->process->pid, this->trdid ); 
-#endif
-
-    ///////////////////////////// create <..> dentry 
+printk("\n[%s] thread[%x,%x] registered dentry <.> in child mapper / cycle %d\n", 
+__FUNCTION__, this->process->pid, this->trdid, cycle ); 
+#endif
+
+    }
+
+    ///////////////////////////// create <..> dentry ///////////////////////
     if( child_cxy == local_cxy )     
     {
@@ -3026,7 +3034,8 @@
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] created dentry <..> (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, child_cxy, dentry_ptr );
+printk("\n[%s] thread[%x,%x] created dentry <..> (%x,%x) / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, child_cxy, dentry_ptr, cycle );
 #endif
 
@@ -3053,34 +3062,41 @@
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry <..> to parent and child inodes\n", 
-__FUNCTION__, this->process->pid, this->trdid ); 
+printk("\n[%s] thread[%x,%x] linked dentry <..> to parent and child inodes / cycle %d\n", 
+__FUNCTION__, this->process->pid, this->trdid, cycle ); 
 #endif
 
     // introduce <..> dentry into child directory mapper
-    if( child_cxy == local_cxy )
-    { 
-        error = vfs_fs_add_dentry( child_ptr,
-                                   dentry_ptr );
-    }
-    else
-    {
-        rpc_vfs_fs_add_dentry_client( child_cxy,
-                                      child_ptr,
-                                      dentry_ptr,
-                                      &error );
-    }
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot introduce dentry <..> in mapper %x\n",
-        __FUNCTION__ );
-        return -1;
-    }
+    // only if the target directory is not the root VFS
+    if( child_xp != parent_xp )
+    {
+        if( child_cxy == local_cxy )
+        { 
+            error = vfs_fs_add_dentry( child_ptr,
+                                       dentry_ptr );
+        }
+        else
+        {
+            rpc_vfs_fs_add_dentry_client( child_cxy,
+                                          child_ptr,
+                                          dentry_ptr,
+                                          &error );
+        }
+        if( error )
+        {
+            printk("\n[ERROR] in %s : cannot introduce dentry <..> in mapper %x\n",
+            __FUNCTION__ );
+            return -1;
+        }
 
 #if(DEBUG_VFS_ADD_SPECIAL & 1)
+cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] registered dentry <..> in child mapper\n", 
-__FUNCTION__, this->process->pid, this->trdid ); 
-#endif
+printk("\n[%s] thread[%x,%x] registered dentry <..> in child mapper / cycle %d\n", 
+__FUNCTION__, this->process->pid, this->trdid, cycle ); 
+#endif
+
+    }
 
 #if DEBUG_VFS_ADD_SPECIAL
