From a75f22ef8a9d7774fe90456f0954631bcc57d5c6 Mon Sep 17 00:00:00 2001 From: RoyHuang Date: Sat, 20 Jun 2026 13:59:47 +0800 Subject: [PATCH] Mark new dir block buffer dirty to persist nr_blk init simplefs_get_new_ext() initializes each new directory block with files[0].nr_blk = SIMPLEFS_FILES_PER_BLOCK but released the buffer without mark_buffer_dirty(), so the init was never written back. After a remount the block reads back all-zero (nr_blk == 0) and the "_fi += nr_blk" scan in __file_lookup() never advances -> kernel soft-lockup. --- inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/inode.c b/inode.c index 4c8dc02..cef4922 100644 --- a/inode.c +++ b/inode.c @@ -430,6 +430,7 @@ static int simplefs_get_new_ext(struct super_block *sb, dblock = (struct simplefs_dir_block *) bh->b_data; memset(dblock, 0, sizeof(struct simplefs_dir_block)); dblock->files[0].nr_blk = SIMPLEFS_FILES_PER_BLOCK; + mark_buffer_dirty(bh); RELEASE_BUFFER_HEAD(bh); } return 0;