Commit 855c339
authored
Fix potential EIO error (#51)
If we use 'dd if=/dev/random of=test.img bs=1M count=32' rather
than 'if=/dev/zero' and mount it, it will cause an EIO error and
get stuck in a loop.
This commit addresses an issue where the 'ls' command would read random,
meaningless values from 'simplefs_file_ei_block' for uninitialized
blocks. This occurred because the blocks contained residual data,
leading to erroneous outputs.
Changes:
1. Clear the root extent block during the 'mkfs' process to prevent
erroneous 'simplefs_file_ei_block' data.
2. Ensure that file data blocks are cleared immediately upon
allocation to prevent erroneous 'simplefs_file' data.
Close #20 and #501 parent 5e11fa7 commit 855c339
4 files changed
+39
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| |||
1002 | 1002 | | |
1003 | 1003 | | |
1004 | 1004 | | |
1005 | | - | |
| 1005 | + | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | 1008 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
239 | 252 | | |
240 | 253 | | |
241 | 254 | | |
| |||
315 | 328 | | |
316 | 329 | | |
317 | 330 | | |
318 | | - | |
| 331 | + | |
319 | 332 | | |
320 | 333 | | |
321 | 334 | | |
| |||
0 commit comments