From 8a1aa3663ae592be7747a8920f3efed1cc863a06 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 1 Dec 2022 07:32:19 -0700 Subject: [PATCH] Allow removal of temporary directory hardlinks These will only exist in the middle of rename --- src/transaction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transaction.rs b/src/transaction.rs index fe07ccfd37..8b6ba3cf64 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -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)); }