We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da98a83 commit 45d5e08Copy full SHA for 45d5e08
kernel/src/filesystem/fat/fs.rs
@@ -1740,6 +1740,10 @@ impl IndexNode for LockedFATInode {
1740
Ok(())
1741
}
1742
fn resize(&self, len: usize) -> Result<(), SystemError> {
1743
+ //检查是否超过fat支持的最大容量
1744
+ if (len as u64) > MAX_FILE_SIZE {
1745
+ return Err(SystemError::EFBIG);
1746
+ }
1747
// 先调整页缓存:清除被截断区间的缓存页,再缩容缓存大小
1748
if let Some(page_cache) = self.page_cache() {
1749
let start_page = (len + MMArch::PAGE_SIZE - 1) >> MMArch::PAGE_SHIFT;
0 commit comments