Print this page
7656 unlinking directory on tmpfs can cause kernel panic

*** 45,60 **** returns, but the removal of the file contents is postponed until all references to the file are closed. If the path argument is a directory and the filesystem supports ! unlink() and unlinkat() on directories, the directory is unlinked from ! its parent with no cleanup being performed. In UFS, the disconnected ! directory will be found the next time the filesystem is checked with ! fsck(1M). The unlink() and unlinkat() functions will not fail simply ! because a directory is not empty. The user with appropriate privileges ! can orphan a non-empty directory without generating an error message. If the path argument is a directory and the filesystem does not support unlink() and unlink() on directories (for example, ZFS), the call will fail with errno set to EPERM. --- 45,56 ---- returns, but the removal of the file contents is postponed until all references to the file are closed. If the path argument is a directory and the filesystem supports ! unlink() and unlinkat() on directories the behaviour is dependent on ! the filesystem. If the path argument is a directory and the filesystem does not support unlink() and unlink() on directories (for example, ZFS), the call will fail with errno set to EPERM.
*** 178,183 **** rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), attributes(5), privileges(5), fsattr(5) ! May 18, 2007 UNLINK(2) --- 174,179 ---- rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), attributes(5), privileges(5), fsattr(5) ! December 15, 2016 UNLINK(2)