diff --git a/kernel/src/fs/ext2/FileSystem.cpp b/kernel/src/fs/ext2/FileSystem.cpp index 31a80ec6..9735f3a9 100644 --- a/kernel/src/fs/ext2/FileSystem.cpp +++ b/kernel/src/fs/ext2/FileSystem.cpp @@ -27,7 +27,8 @@ namespace Ext2 Result> FileSystem::find_inode_by_number(ino_t inum, bool initialize_dir_now) { - check(inum < m_superblock.nr_inodes); + // Inode numbers start at 1. + check(inum <= m_superblock.nr_inodes); auto maybe_inode = m_inode_cache.try_get(inum); if (maybe_inode.has_value()) return maybe_inode.value();