Allow removal of temporary directory hardlinks

These will only exist in the middle of rename
This commit is contained in:
Jeremy Soller
2022-12-01 07:32:19 -07:00
parent f601b2a8ce
commit 8a1aa3663a
+1 -1
View File
@@ -628,7 +628,7 @@ impl<'a, D: Disk> Transaction<'a, D> {
// Read node and test type against requested type
let node = self.read_tree(node_ptr)?;
if node.data().mode() & Node::MODE_TYPE == mode {
if node.data().is_dir() && node.data().size() > 0 {
if node.data().is_dir() && node.data().size() > 0 && node.data().links() == 1 {
// Tried to remove directory that still has entries
return Err(Error::new(ENOTEMPTY));
}