fix: ext2 directory insertion; racing on inode create
authorLunaixsky <lunaixsky@qq.com>
Sat, 3 May 2025 00:45:01 +0000 (01:45 +0100)
committerLunaixsky <lunaixsky@qq.com>
Sat, 3 May 2025 17:47:28 +0000 (18:47 +0100)
commit4cf445cb569be5f1f078ea27fd5d1b172402f44f
treef2aeacd6c15f5123ac8096d4f6ea66cf878818cf
parent14046412dd248f8ae504cf75788edc480f2313d0
fix: ext2 directory insertion; racing on inode create

use nesting lock for v_inode and v_dnode locking.

hold the lock on the parent directory upon creating inode
prevent contention across multiple process that partakes
similar actions

fix the edge case of dirent insertion with data block
boundary crossing.

fix the incorrect calculation between fsblock index and
ext2 data block/inode index.

new test case: fragfile - random file spammer
13 files changed:
lunaix-os/includes/lunaix/ds/mutex.h
lunaix-os/includes/lunaix/fs.h
lunaix-os/kernel/ds/mutex.c
lunaix-os/kernel/fs/LConfig
lunaix-os/kernel/fs/ext2/LConfig [new file with mode: 0644]
lunaix-os/kernel/fs/ext2/dir.c
lunaix-os/kernel/fs/ext2/ext2.h
lunaix-os/kernel/fs/ext2/file.c
lunaix-os/kernel/fs/ext2/group.c
lunaix-os/kernel/fs/ext2/inode.c
lunaix-os/kernel/fs/vfs.c
lunaix-os/usr/LBuild
lunaix-os/usr/fragfile.c [new file with mode: 0644]