Commit ab628ed
authored
[WasmFS] Move O_TRUNC handling to avoid crash (#17192)
WasmFS backends like OPFS may reasonably expect that files will only be modified
while open and may be unprepared to modify unopened files. However, when
handling O_TRUNC, we truncated files before opening them in the backend. For the
OPFS backend in particular, this caused a crash because the backend did not yet
have an AccessHandle for the file. Fix the problem by deferring O_TRUNC handling
until after we have asked the backend to open the file.1 parent 51281a3 commit ab628ed
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
468 | 472 | | |
469 | 473 | | |
470 | 474 | | |
| |||
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
477 | | - | |
478 | 481 | | |
479 | 482 | | |
480 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| |||
0 commit comments