Skip to content

Commit 24c1cfb

Browse files
committed
fix block address resolution for block sizes other than 1024
1 parent 5957f84 commit 24c1cfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext2/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ where
147147
}
148148

149149
fn resolve_block_offset(&self, addr: BlockAddress) -> usize {
150-
(1024 + (addr.get() - 1) * self.superblock.block_size()) as usize
150+
(addr.get() * self.superblock.block_size()) as usize
151151
}
152152

153153
pub fn allocate_block(&mut self) -> Result<Option<BlockAddress>, Error> {

0 commit comments

Comments
 (0)