[RFC] Fix SMB2 aio cancelling
ttalpey at microsoft.com
Fri Nov 2 16:22:08 UTC 2018
[Re-adding samba-technical list]
> -----Original Message-----
> From: samba-technical <samba-technical-bounces at lists.samba.org> On Behalf
> Of Ralph Böhme via samba-technical
> Sent: Sunday, October 28, 2018 3:04 PM
> To: Samba Technical <samba-technical at lists.samba.org>
> Cc: Stefan Metzmacher <metze at samba.org>; Volker Lendecke
> <Volker.Lendecke at SerNet.DE>; Jeremy Allison <jra at samba.org>
> Subject: [RFC] Fix SMB2 aio cancelling
> I guess the correct thing to do wrt to implementing SMB2 cancel requests of
> reads and writes, as long as we don't attempt to cancel the internal aio
> requests, is to just ignore the SMB2 cancel.
> This is what MS-SMB2 has to say about it:
> MS-SM2 22.214.171.124:
> If the target request is not successfully canceled, processing of the target
> request MUST continue and no response is sent to the cancel request.
So, CANCEL is always advisory, and in fact in normal operation, no response should
ever be generated for CANCEL. The *target* operation is either unaffected, canceled,
or expedited, as the server chooses. In fact, many operations may never be canceled,
and remember the CANCEL can show up after a request is already complete, or in
multichannel cases, not even seen. It's perfectly OK for the server to simply ignore it,
at any time (although best for the server to actually try!).
The only case in which CANCEL is responded-to is if the CANCEL was somehow malformed.
Generally, that's performed in the common request processing.
More information about the samba-technical