4
1
mirror of https://github.com/DragonOS-Community/DragonOS.git synced 2025-07-11 02:53:25 +00:00

fix: 检查栈帧大小 (#1126)

* feat: 打开clippy的stack overflow静态检查

*限制栈大小最大为4096字节
*限制栈中的数组最大为1024字节

* fix: 修复部分函数的爆栈问题 (#1172)

* fix:修复部分函数的爆栈问题

* feat(filesystem): 重构FAT文件系统重命名和移动文件逻辑

将rename_file_in_same_dir和move_file_to_other_dir函数重构为LockedFATInode的方法,优化代码结构。同时更新clippy配置,添加栈大小和数组大小阈值。

Signed-off-by: longjin <longjin@DragonOS.org>

---------

Signed-off-by: longjin <longjin@DragonOS.org>
Co-authored-by: longjin <longjin@DragonOS.org>

---------

Signed-off-by: longjin <longjin@DragonOS.org>
Co-authored-by: DoL <1240800466@qq.com>
Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
YJwu2023
2025-05-26 17:33:25 +08:00
committed by GitHub
parent a56444e1ad
commit ef9c935732
9 changed files with 117 additions and 71 deletions
kernel
.clippy.toml
src
arch
x86_64
driver
interrupt
mm
driver
disk
ahci
tty
tty_ldisc
filesystem
lib.rs
mm

@ -1,4 +1,3 @@
use alloc::boxed::Box;
use core::{
alloc::Layout,
cmp::{max, min},
@ -634,9 +633,7 @@ impl PageFaultHandler {
// TODO 同步预读
//涉及磁盘IO返回标志为VM_FAULT_MAJOR
ret = VmFaultReason::VM_FAULT_MAJOR;
let mut buffer = Box::new([0u8; MMArch::PAGE_SIZE]);
let mut buffer = vec![0u8; MMArch::PAGE_SIZE];
file.pread(
file_pgoff * MMArch::PAGE_SIZE,
MMArch::PAGE_SIZE,