Skip to content

Commit 749f461

Browse files
committed
unlink the new path from unlinked inode
1 parent 8ffe897 commit 749f461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/inode_table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ impl InodeTable {
195195

196196
/// Remove the path->inode mapping for a given path, but keep the inode around.
197197
pub fn unlink(&mut self, path: &Path) {
198-
self.by_path.remove(Pathish::new(path));
199-
// Note that the inode->path mapping remains.
198+
let idx = self.by_path.remove(Pathish::new(path)).unwrap();
199+
self.table[idx].path = None;
200200
}
201201

202202
/// Get a free indode table entry and its number, either by allocating a new one, or re-using

0 commit comments

Comments
 (0)