summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-03-10 10:55:22 -0700
committerKarolin Seeger <kseeger@samba.org>2020-04-07 08:12:34 +0000
commit8a6dc998ec6da2bfa19aea8b4060f27a1d2f11b9 (patch)
tree964f54103915741defa834e142640b78ab0f7cfb /source3/smbd/aio.c
parentbb646d6b5b8b08635720cf296de44b8e1bc4da42 (diff)
downloadsamba-8a6dc998ec6da2bfa19aea8b4060f27a1d2f11b9.tar.gz
s3: smbd: In aio_del_req_from_fsp() talloc_free(fsp->aio_requests[]) when fsp->num_aio_requests reaches zero.
The add code in aio_add_req_to_fsp() re-tallocs this array on demand, and talloc freeing it here allows it to be used as the parent for a tevent wait queue, so callers can get notified when all outstanding aio on an fsp is finished. We'll deal with any performance issues in the next commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 0c952bba1edf7c8173d05ccdc6fdaa7232d2c6aa)
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 0f824f5aa1f..afe76608cd3 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -103,6 +103,7 @@ static int aio_del_req_from_fsp(struct aio_req_fsp_link *lnk)
if (fsp->num_aio_requests == 0) {
tevent_wait_done(fsp->deferred_close);
+ TALLOC_FREE(fsp->aio_requests);
}
return 0;
}