s3:smbd: don't use async dosmode if per-thread cwd is not available
authorRalph Boehme <slow@samba.org>
Mon, 7 Jan 2019 20:10:19 +0000 (21:10 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 11 Jan 2019 22:11:18 +0000 (23:11 +0100)
The additional overhead for the async processing should be avoided when
we know the lower level has to fallback to sync processing anyway.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_query_directory.c

index 6020025..fdb8718 100644 (file)
@@ -516,6 +516,9 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                size_t max_threads;
 
                max_threads = pthreadpool_tevent_max_threads(conn->sconn->pool);
+               if (max_threads == 0 || !per_thread_cwd_supported()) {
+                       state->async_dosmode = false;
+               }
 
                state->max_async_dosmode_active = lp_smbd_max_async_dosmode(
                                                        SNUM(conn));