From 0cb26bc95ebc22323c962595f615848d8b10fec6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Jun 2020 15:01:49 -0700 Subject: [PATCH] s3: smbd: Allow a SHUTDOWN_CLOSE on a file with outstanding aio if there are no client connections alive. The process is exiting now so pthreads will never complete to cause problems. Signed-off-by: Jeremy Allison --- source3/smbd/close.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index d5af62a277c..1e84057a170 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -639,12 +639,17 @@ static NTSTATUS ntstatus_keeperror(NTSTATUS s1, NTSTATUS s2) static void assert_no_pending_aio(struct files_struct *fsp, enum file_close_type close_type) { + struct smbXsrv_client *client = global_smbXsrv_client; unsigned num_requests = fsp->num_aio_requests; if (num_requests == 0) { return; } + if (close_type == SHUTDOWN_CLOSE && client->connections == NULL) { + return; + } + DBG_ERR("fsp->num_aio_requests=%u\n", num_requests); smb_panic("can not close with outstanding aio requests"); return; -- 2.20.1