From 3b0d9a8fb57dd673b2ddee09078107d32a5611f8 Mon Sep 17 00:00:00 2001 From: Lanzheng Liu Date: Thu, 16 Nov 2023 17:12:35 +0800 Subject: [PATCH] marking inode 1 inuse for extfs/mkfs (#247) Signed-off-by: liulanzheng --- fs/extfs/mkfs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/extfs/mkfs.cpp b/fs/extfs/mkfs.cpp index addd93f9..42cc9bd1 100644 --- a/fs/extfs/mkfs.cpp +++ b/fs/extfs/mkfs.cpp @@ -116,6 +116,7 @@ int do_mkfs(io_manager manager, size_t size, char *uuid) { return ret; } // reserve inodes + ext2fs_inode_alloc_stats2(fs, EXT2_BAD_INO, +1, 0); for (ext2_ino_t i = EXT2_ROOT_INO + 1; i < EXT2_FIRST_INODE(fs->super); i++) ext2fs_inode_alloc_stats2(fs, i, +1, 0); ext2fs_mark_ib_dirty(fs);