From: Ralph Boehme Date: Tue, 8 Jan 2019 06:38:53 +0000 (+0100) Subject: vfs_default: add sync fallback to fsync_send/recv X-Git-Tag: talloc-2.1.15~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f406fee523692e4dc4b11b13637dcbabaabe8c7;p=thirdparty%2Fsamba.git vfs_default: add sync fallback to fsync_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 57ce0b465ec..8d40cd64540 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -988,8 +988,18 @@ static void vfs_fsync_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_fsync_do(state); } tevent_req_done(req);