kernel: misc stuff

This commit is contained in:
Matheus
2023-08-08 21:20:58 -03:00
parent b26ed0bb18
commit c33078b9c2
4 changed files with 11 additions and 8 deletions
+5
View File
@@ -1309,6 +1309,11 @@ static int ext2_link(vnode_t *vnode, vnode_t *dirvnode, char *name, cred_t *cred
if (err)
goto cleanup;
// if the node is in memory without any filesystem links,
// undo the release done by ext2_unlink
if (node->inode.links == 0)
VOP_HOLD(&node->vnode);
node->inode.links += 1;
ASSERT_UNCLEAN(fs, writeinode(fs, &node->inode, node->id) == 0);