Patches for

Jeremy Allison jra at
Wed May 6 16:59:43 MDT 2015

On Wed, May 06, 2015 at 09:29:00PM +0200, Michael Adam wrote:
> Metze's argument (I briefly discussed with him) is that
> it was this way before. And since only the last in a
> compound (except for oplock breaking create) can go async
> and is taken out of the compound then, we are not in danger.

OK, thought through the logic really carefully.

If we have a pending notify on the processing queue
not in a compound, then when smbd_smb2_session_setup_wrap_setup_done()
gets called, it calls smb2srv_session_shutdown_send()
which will call tevent_req_cancel() on any pending

Metze is (of course :-) correct in that we will
*always* call tevent_req_cancel() on a notify,
as the cannot be inside a compound, and can only
be at the end - in which case it's split out.

> But the concern is this: doesn't the introduction of the
> Queue introduce a new potential for blocking (by prevent
> the session from being freed waiting for the notify to disappear)?

No, I don't think so (and remember the tevent_queue was
already there, metze's patch just moved it). See
above - the session free call will *always* call
tevent_req_cancel() on an any awaiting notify,
and once smb2srv_session_shutdown_send() is called
we set session->status = NT_STATUS_USER_SESSION_DELETED;
so no more SMB2 requests will be accepted on this

More information about the samba-technical mailing list