From 240a687d8f5bc830376fc07a02990346e89a4283 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 28 Oct 2023 16:48:54 +0300 Subject: [PATCH] Kernel: Fix ext2 inode block allocation with triply indirect blocks --- kernel/kernel/FS/Ext2/Inode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/kernel/FS/Ext2/Inode.cpp b/kernel/kernel/FS/Ext2/Inode.cpp index 28c0afc75b..92aef05fe1 100644 --- a/kernel/kernel/FS/Ext2/Inode.cpp +++ b/kernel/kernel/FS/Ext2/Inode.cpp @@ -806,9 +806,8 @@ needs_new_block: // triply indirect block if (block_array_index < indices_per_fs_block * indices_per_fs_block * indices_per_fs_block) { - dwarnln("here"); READ_OR_ALLOCATE_BASE_BLOCK(14); - READ_OR_ALLOCATE_INDIRECT_BLOCK(indirect_block, block_array_index / (indices_per_fs_block * indices_per_fs_block), 14); + READ_OR_ALLOCATE_INDIRECT_BLOCK(indirect_block, block_array_index / (indices_per_fs_block * indices_per_fs_block), m_inode.block[14]); READ_OR_ALLOCATE_INDIRECT_BLOCK(direct_block, (block_array_index / indices_per_fs_block) % indices_per_fs_block, indirect_block); WRITE_BLOCK_AND_RETURN(block_array_index % indices_per_fs_block, direct_block); }