summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-01-08 07:38:04 +0100
committerStefan Metzmacher <metze@samba.org>2019-01-11 23:11:18 +0100
commitbc539d8104fcf7954331df1d4385ad84343c919a (patch)
treea87e1e9a745f798c2f1f3b38b64f009ca0e62f5d /source3
parent57e2fb018f2040d1e2d487a4590f103022496b44 (diff)
downloadsamba-bc539d8104fcf7954331df1d4385ad84343c919a.tar.gz
vfs_default: add sync fallback to pread_send/recv
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_default.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 256f173aec5..4ca7578cc53 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -742,8 +742,18 @@ static void vfs_pread_done(struct tevent_req *subreq)
TALLOC_FREE(subreq);
SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes);
talloc_set_destructor(state, NULL);
- if (tevent_req_error(req, ret)) {
- return;
+ if (ret != 0) {
+ if (ret != EAGAIN) {
+ tevent_req_error(req, ret);
+ return;
+ }
+ /*
+ * If we get EAGAIN from pthreadpool_tevent_job_recv() this
+ * means the lower level pthreadpool failed to create a new
+ * thread. Fallback to sync processing in that case to allow
+ * some progress for the client.
+ */
+ vfs_pread_do(state);
}
tevent_req_done(req);