Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6f710a

Browse files
committed
feat: add write support to virtual file-system
1 parent9a5bb2a commita6f710a

File tree

2 files changed

+1108
-18
lines changed

2 files changed

+1108
-18
lines changed

‎host/src/vfs/limits.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ pub struct VfsLimits {
1919
///
2020
/// Keep this to a rather small size to prevent super-linear complexity due to string hashing.
2121
pubmax_path_segment_size:u64,
22+
23+
/// Maximum total VFS storage in bytes.
24+
///
25+
/// This limits the total amount of data that can be stored in the VFS to prevent DoS attacks.
26+
pubmax_storage_bytes:u64,
27+
28+
/// Maximum size of a single file in bytes.
29+
///
30+
/// This prevents a single file from consuming all available storage.
31+
pubmax_file_size:u64,
32+
33+
/// Maximum number of write operations per second.
34+
///
35+
/// This rate-limits write operations to prevent DoS attacks through excessive I/O.
36+
pubmax_write_ops_per_sec:u32,
2237
}
2338

2439
implDefaultforVfsLimits{
@@ -27,6 +42,9 @@ impl Default for VfsLimits {
2742
inodes:10_000,
2843
max_path_length:255,
2944
max_path_segment_size:50,
45+
max_storage_bytes:100*1024*1024,// 100MB total storage
46+
max_file_size:10*1024*1024,// 10MB per file
47+
max_write_ops_per_sec:1000,// 1000 write ops/sec
3048
}
3149
}
3250
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp