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/include/vfs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include/vfs.h') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index c4ef5a3046..c5b896db0f 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -251,6 +251,15 @@ typedef struct files_struct { unsigned num_aio_requests; struct tevent_req **aio_requests; + + /* + * If a close request comes in while we still have aio_requests + * around, we need to hold back the close. When all aio_requests are + * done, the aio completion routines need tevent_wait_done() on + * this. A bit ugly, but before we have close_file() fully async + * possibly the simplest approach. Thanks, Jeremy for the idea. + */ + struct tevent_req *deferred_close; } files_struct; struct vuid_cache_entry { -- cgit