diff --git a/src/ext2/structs.rs b/src/ext2/structs.rs index ecdee80..8551049 100644 --- a/src/ext2/structs.rs +++ b/src/ext2/structs.rs @@ -194,7 +194,7 @@ impl Inode { Some(block) } } else if block < (12 + num_sing_indir + num_doub_indir) as u32 { - let base_block = 12 - num_sing_indir; + let base_block = 12 + num_sing_indir; let doub_indir_offset = (block as usize - base_block) / num_sing_indir; let sing_indir_offset = (block as usize - base_block) % num_sing_indir; let sing_indir_blocks = self @@ -210,7 +210,7 @@ impl Inode { Some(block) } } else if block < (12 + num_sing_indir + num_doub_indir + num_trip_indir) as u32 { - let base_block = 12 - num_sing_indir; + let base_block = 12 + num_sing_indir + num_doub_indir; let trip_indir_offset = (block as usize - base_block) / num_doub_indir; let doub_indir_offset = ((block as usize - base_block) % num_doub_indir) / num_sing_indir;