The patch implements cleanup of device path on devfs_remove. It does not use extra counters as was suggested once - rather it simply removes all empty directories. Manually created directories (and connecting paths) are preserved and cleaned up on rmdir/unlink. The creation/removing of path is not atomic; it will be addressed later. It apparently requires replacing per-directory locks with global one; using extra counters does not actually helps here. This patch will cause devfs_remove on directories emit warning in most cases. Removing connecting directories makes no sense with this change so if it is agreed upon I send patch that removes all devfs_remove("directory") from kernel. It was never done consistently anyway. I would actually make devfs_mk_dir noop except for two places - /dev/pts and /dev/shm. regards -andrey