Repository navigation
Commit b73db66
fuse: adopt a FUSE_INIT negotiation only once its reply is sent
Session::dispatch_init negotiated in the session's own SessionInfo,
under its write lock, and marked the session initialized only after it
sent the reply (microsoft/nvx#1898). When the reply could not be sent,
as when a virtio-fs client's buffers cannot hold it, the session stayed
uninitialized but kept the values of the attempt that the client never
received. save_state then saved them with initialized false, which
SessionState::validate refuses as UninitializedWithInfo, so such a save
could not be restored, and a dormant microVM virtio-fs slot refused to
save at all. A later FUSE_INIT reset only the fields that dispatch_init
sets before Fuse::init, so the failed attempt's max_background and
congestion_threshold reached the file system's init, the reply, and
the saved state of the next negotiation.
dispatch_init now negotiates in a SessionInfo of the request's own,
built from the defaults and the client's offer alone, and stores it in
the session, and marks the session initialized, only once the reply is
sent. A reply that cannot be sent, like a negotiation that the session
refuses, leaves the session as it was: uninitialized, without a
negotiation. A FUSE_INIT whose reply is sent negotiates, replies, and
saves as before. Fuse::init documents it.
Tests, in fuse's session tests of init, with a sender that fails each
reply with WriteZero, and a file system that records what each init
receives and allows more background requests when the client offers
FUSE_ASYNC_DIO:
- init_whose_reply_fails_leaves_no_negotiation fails at
feature/microvm/dev 899dcd6: the uninitialized session saves the
failed attempt's version 7.39, capabilities, and background limits.
- init_after_a_failed_reply_negotiates_afresh, whose second FUSE_INIT
offers only FUSE_ASYNC_READ at 7.31, fails there: that reply carries
the failed attempt's background limits, (64, 48) instead of (0, 0).
With the fix, its reply, what init receives, and the saved state
match those of a new session.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 899dcd6 commit b73db66
3 files changed
Lines changed: 115 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
481 | 487 | | |
482 | 488 | | |
483 | 489 | | |
484 | 490 | | |
485 | 491 | | |
486 | | - | |
487 | | - | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
492 | 496 | | |
493 | 497 | | |
494 | | - | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
517 | | - | |
518 | 521 | | |
519 | 522 | | |
520 | 523 | | |
| |||
532 | 535 | | |
533 | 536 | | |
534 | 537 | | |
| 538 | + | |
| 539 | + | |
535 | 540 | | |
536 | 541 | | |
537 | | - | |
| 542 | + | |
| 543 | + | |
538 | 544 | | |
539 | 545 | | |
540 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
0 commit comments