update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
1 changed files with 5 additions and 1 deletions
Showing only changes of commit 4e785a133c - Show all commits

View File

@ -274,6 +274,9 @@ namespace Kernel
{
ASSERT(m_inode.links_count == 0);
if (mode().iflnk() && (size_t)size() < sizeof(m_inode.block))
goto done;
// cleanup direct blocks
for (uint32_t i = 0; i < 12; i++)
if (m_inode.block[i])
@ -287,6 +290,7 @@ namespace Kernel
if (m_inode.block[14])
cleanup_indirect_block(m_inode.block[14], 3);
done:
// mark blocks as deleted
memset(m_inode.block, 0x00, sizeof(m_inode.block));
@ -759,7 +763,7 @@ needs_new_block:
if (data_block_index < indices_per_fs_block * indices_per_fs_block)
return TRY(allocate_new_block_to_indirect_block(m_inode.block[13], data_block_index, 2));
data_block_index -= indices_per_fs_block;
data_block_index -= indices_per_fs_block * indices_per_fs_block;
if (data_block_index < indices_per_fs_block * indices_per_fs_block * indices_per_fs_block)
return TRY(allocate_new_block_to_indirect_block(m_inode.block[14], data_block_index, 3));