When rmdir() is called with a mounpoint (directory with a mounted filesystem) name as the argument, it returns ENOENT error code. It appears that there is a bug in the do_rmdir() routine (fs/namei.c module): ........... dentry = lookup_dentry(name, NULL, 0); ........... dir = dget(dentry->d_parent); ........... error = -ENOENT; if (check_parent(dir, dentry)) error = vfs_rmdir(dir->d_inode, dentry); ........... lookup_dentry() will return the dentry for the root of the mounted filesystem, thus resulting in that dir will be the same as dentry (d_parent field of "/" points to itself). After that, check_parent() will fail (because dir == dentry), and ENOENT will be returned. Clearly, "no such file or directory" is not the right way to tell the user that she's trying to rmdir() a mountpoint. Changing check_parent() to: #define check_parent(dir, dentry) \ ((dir) == (dentry) || (dir) == (dentry)->d_parent && !list_empty(&dentry->d_hash)) fixes the problem, but that might cause some trouble with parent locking, or am I wrong?