By default, directories created in the root dir do not increase the root's i_nlink, which prevents the "find" command from finding subdirectories. This fix increases the i_nlink for entries created in the root dir. More generally, this should be applied to every syscall which changes a property of the root (eg: chmod/chown). Right now, doing a chmod on the root only applies it to the original fs. --- ./fs/evfs/evfs_core.c.nocrash 2007-01-03 15:49:35 +0100 +++ ./fs/evfs/evfs_core.c 2007-01-03 16:37:48 +0100 @@ -663,6 +663,14 @@ if((file = inode_dentry_name(ino, dentry)) == NULL) return(-ENOMEM); fs = get_fs(); set_fs(KERNEL_DS); err = sys_mkdir(file, mode); + if (!err) { + /* inc usecount for root */ + if (ino->i_sb->s_root->d_inode == ino) { + ino->i_nlink++; + mark_inode_dirty(ino); + } + } + set_fs(fs); kfree(file); return(err); @@ -677,6 +685,13 @@ if((file = inode_dentry_name(ino, dentry)) == NULL) return(-ENOMEM); fs = get_fs(); set_fs(KERNEL_DS); err = sys_rmdir(file); + if (!err) { + /* dec usecount for root */ + if (ino->i_sb->s_root->d_inode == ino) { + ino->i_nlink--; + mark_inode_dirty(ino); + } + } set_fs(fs); kfree(file); return(err);