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

View File

@ -55,8 +55,11 @@ pub fn ahci_init() -> Result<(), SystemError> {
let standard_device = device.as_standard_device().unwrap();
standard_device.bar_ioremap();
// 对于每一个ahci控制器分配一块空间
let ahci_port_base_vaddr =
Box::leak(Box::new([0u8; (1 << 20) as usize])) as *mut u8 as usize;
// let ahci_port_base_vaddr =
// Box::leak(Box::new([0u8; (1 << 20) as usize])) as *mut u8 as usize;
let buffer = Box::leak(vec![0u8; (1 << 20) as usize].into_boxed_slice());
let ahci_port_base_vaddr = buffer.as_mut_ptr() as usize;
let virtaddr = standard_device
.bar()
.ok_or(SystemError::EACCES)?

View File

@ -149,8 +149,8 @@ impl NTtyData {
cursor_column: 0,
canon_cursor_column: 0,
echo_tail: 0,
read_buf: Box::new([0; NTTY_BUFSIZE]),
echo_buf: Box::new([0; NTTY_BUFSIZE]),
read_buf: vec![0; NTTY_BUFSIZE].into_boxed_slice().try_into().unwrap(),
echo_buf: vec![0; NTTY_BUFSIZE].into_boxed_slice().try_into().unwrap(),
read_flags: StaticBitmap::new(),
char_map: StaticBitmap::new(),
tty: Weak::default(),