Kernel: Fix Ext2 bug for big files

My ext2 implementation was reading wrong blocks for very big block
indices.
This commit is contained in:
Bananymous 2025-04-18 04:17:31 +03:00
parent 9258c73484
commit 703c1a485c
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ namespace Kernel
const uint32_t indices_per_block = blksize() / sizeof(uint32_t);
const uint32_t divisor = (depth > 1) ? indices_per_block * (depth - 1) : 1;
uint32_t divisor = 1;
for (uint32_t i = 1; i < depth; i++)
divisor *= indices_per_block;
const uint32_t next_block = block_buffer.span().as_span<uint32_t>()[(index / divisor) % indices_per_block];
if (next_block == 0)