Project

General

Profile

Feature #11015

SMB2 async redesign

Added by Gordon Ross 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-05-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

SMB2 leasing requires a more capable implementation of the logic
used to change an SMB2/3 request to run asynchronously.

The old implementation used a simple but limited design where the
dispatch loop allows one request in a sequence to set a "call back"
function used for "async" processing, which the dispatcher would
call after the request sequence is complete.

The new implementation instead essentially "re-enters" the SMB command
dispatch loop (actually a special variant of that loop called "go async") and then:

if we've not already "gone async" the "go async" funciton:
  • saves our position (etc.) in the SMB command sequence
  • constructs the required "interim responses" (with STATUS_PENDING) for the current and all remaining commands in the sequence
  • sends a compound response containing those interim responses
  • restores our position to where it was in step 1
  • marks the request state as "async".
    After the request has "gone async", any request processing that needs to
    block for longer than a few milliseconds may do so without causing problems.

The SMB leasing support introduces some new cases where the SMB2 code
needs to block where the old async design would be inadequate.

Testing:

This commit does not have its own functional verification test,
but regression tests should pass. We can consider this verified if the
oplock work in #11016 passes its tests.

History

#1

Updated by Gordon Ross 5 months ago

  • Description updated (diff)
  • Status changed from New to In Progress

Fix in production since late 2016

#2

Updated by Gordon Ross 4 months ago

  • Description updated (diff)
#3

Updated by Electric Monk 4 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 148d1a4158dc830f7b293a2ceb62ee54c2ebd72f

commit  148d1a4158dc830f7b293a2ceb62ee54c2ebd72f
Author: Matt Barden <matt.barden@nexenta.com>
Date:   2019-06-09T00:48:43.000Z

    11015 SMB2 async redesign
    Reviewed by: Gordon Ross <gwr@nexenta.com>
    Reviewed by: Evan Layton <evan.layton@nexenta.com>
    Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF