From: Jeremy Allison Date: Fri, 13 Mar 2020 17:38:03 +0000 (-0700) Subject: Revert "s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req... X-Git-Tag: ldb-2.2.0~1413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27e1bfcecca1a1a243b566edfd18b98b2e7ca42c;p=thirdparty%2Fsamba.git Revert "s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req pointer." This reverts commit 18671534e42f66b904e51c3fbe887e998ff79493. Now we wait for all aio to finish on all SHUTDOWN_CLOSE cases, this is no longer needed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index fac7fa30ab7..f9d958a003d 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1151,15 +1151,6 @@ static void vfs_fsync_do(void *private_data) static int vfs_fsync_state_destructor(struct vfswrap_fsync_state *state) { - /* - * This destructor only gets called if the request is still - * in flight, which is why we deny it by returning -1. We - * also set the req pointer to NULL so the _done function - * can detect the caller doesn't want the result anymore. - * - * Forcing the fsp closed by a SHUTDOWN_CLOSE can cause this. - */ - state->req = NULL; return -1; } @@ -1174,17 +1165,6 @@ static void vfs_fsync_done(struct tevent_req *subreq) TALLOC_FREE(subreq); SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes); talloc_set_destructor(state, NULL); - if (req == NULL) { - /* - * We were shutdown closed in flight. No one - * wants the result, and state has been reparented - * to the NULL context, so just free it so we - * don't leak memory. - */ - DBG_NOTICE("fsync request abandoned in flight\n"); - TALLOC_FREE(state); - return; - } if (ret != 0) { if (ret != EAGAIN) { tevent_req_error(req, ret);