Add size check in `InodeDesc::is_fast_symlink`

This commit is contained in:
Chaoqun Zheng 2026-02-01 23:30:57 +08:00
parent 57c7546db0
commit 3cb457b620
1 changed files with 3 additions and 1 deletions

View File

@ -2647,7 +2647,9 @@ impl InodeDesc {
/// ///
/// Reference: <https://elixir.bootlin.com/linux/v6.18/source/fs/ext2/inode.c#L48-L55>. /// Reference: <https://elixir.bootlin.com/linux/v6.18/source/fs/ext2/inode.c#L48-L55>.
fn is_fast_symlink(&self) -> bool { fn is_fast_symlink(&self) -> bool {
self.type_ == InodeType::SymLink && self.data_sectors() == 0 self.type_ == InodeType::SymLink
&& self.data_sectors() == 0
&& self.size <= MAX_FAST_SYMLINK_LEN
} }
} }