From 3e9f58be7e56b7990417e3f97a2d215f3591289e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 17 Jul 2012 22:24:51 +0200 Subject: s3-smb1: Postpone close_file until all aio is handled Thanks to Jeremy for this simple idea Signed-off-by: Jeremy Allison --- source3/smbd/aio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/smbd/aio.c') diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index 1923ef889f..9f7390bba3 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -23,6 +23,7 @@ #include "smbd/globals.h" #include "../lib/util/tevent_ntstatus.h" #include "../lib/util/tevent_unix.h" +#include "lib/tevent_wait.h" /**************************************************************************** The buffer we keep around whilst an aio request is in process. @@ -107,6 +108,10 @@ static int aio_del_req_from_fsp(struct aio_req_fsp_link *lnk) } fsp->num_aio_requests -= 1; fsp->aio_requests[i] = fsp->aio_requests[fsp->num_aio_requests]; + + if (fsp->num_aio_requests == 0) { + tevent_wait_done(fsp->deferred_close); + } return 0; } -- cgit