From: Ralph Boehme Date: Tue, 8 Jan 2019 06:38:04 +0000 (+0100) Subject: vfs_default: add sync fallback to pread_send/recv X-Git-Tag: talloc-2.1.15~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc539d8104fcf7954331df1d4385ad84343c919a;p=thirdparty%2Fsamba.git vfs_default: add sync fallback to pread_send/recv Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- 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);