}
tevent_req_done(subreq);
}
-
-/****************************************************************************
- Handle any aio completion inline.
-*****************************************************************************/
-
-void aio_fsp_close(files_struct *fsp)
-{
- unsigned i;
-
- for (i=0; i<fsp->num_aio_requests; i++) {
- struct tevent_req *req = fsp->aio_requests[i];
- struct aio_extra *aio_ex = tevent_req_callback_data(
- req, struct aio_extra);
- aio_ex->fsp = NULL;
- }
-}
NTSTATUS tmp;
connection_struct *conn = fsp->conn;
- aio_fsp_close(fsp);
+ if (fsp->num_aio_requests != 0) {
+ char *str;
+ /*
+ * reply_close and the smb2 close must have taken care of
+ * this. No other callers of close_file should ever have
+ * created async I/O.
+ *
+ * We need to panic here because if we close() the fd while we
+ * have outstanding async I/O requests, in the worst case we
+ * could end up writing to the wrong file.
+ */
+ DEBUG(0, ("fsp->num_aio_requests=%u\n",
+ fsp->num_aio_requests));
+ smb_panic("can not close with outstanding aio requests");
+ }
/*
* If we're flushing on a close we can get a write
DATA_BLOB in_data,
bool write_through);
bool cancel_smb2_aio(struct smb_request *smbreq);
-void aio_fsp_close(files_struct *fsp);
/* The following definitions come from smbd/blocking.c */