s3: smbd: In aio_del_req_from_fsp() talloc_free(fsp->aio_requests[]) when fsp->num_ai...
authorJeremy Allison <jra@samba.org>
Tue, 10 Mar 2020 17:55:22 +0000 (10:55 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 18 Mar 2020 18:03:28 +0000 (18:03 +0000)
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>
source3/smbd/aio.c

index 0f824f5aa1f69171e7fb71f8c4ec099c313e4cde..afe76608cd3ab0a450a9f9a8dacd336026374770 100644 (file)
@@ -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;
 }