"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "source3/smbd/close.c" between
samba-4.12.3.tar.gz and samba-4.12.5.tar.gz

About: Samba is the standard Windows interoperability suite of programs for Linux and Unix providing secure, stable and fast file and print services for all clients using the SMB/CIFS protocol. 4.12 series.

close.c  (samba-4.12.3):close.c  (samba-4.12.5)
skipping to change at line 641 skipping to change at line 641
{ {
if (!NT_STATUS_IS_OK(s1)) { if (!NT_STATUS_IS_OK(s1)) {
return s1; return s1;
} }
return s2; return s2;
} }
static void assert_no_pending_aio(struct files_struct *fsp, static void assert_no_pending_aio(struct files_struct *fsp,
enum file_close_type close_type) enum file_close_type close_type)
{ {
struct smbXsrv_client *client = global_smbXsrv_client;
size_t num_connections_alive;
unsigned num_requests = fsp->num_aio_requests; unsigned num_requests = fsp->num_aio_requests;
if (num_requests == 0) { if (num_requests == 0) {
return; return;
} }
num_connections_alive = smbXsrv_client_valid_connections(client);
if (close_type == SHUTDOWN_CLOSE && num_connections_alive == 0) {
/*
* fsp->aio_requests and the contents (fsp->aio_requests[x])
* are both independently owned by fsp and are not in a
* talloc heirarchy. This allows the fsp->aio_requests array to
* be reallocated independently of the array contents so it can
* grow on demand.
*
* This means we must ensure order of deallocation
* on a SHUTDOWN_CLOSE by deallocating the fsp->aio_requests[x]
* contents first, as their destructors access the
* fsp->aio_request array. If we don't deallocate them
* first, when fsp is deallocated fsp->aio_requests
* could have been deallocated *before* its contents
* fsp->aio_requests[x], causing a crash.
*/
while (fsp->num_aio_requests != 0) {
TALLOC_FREE(fsp->aio_requests[0]);
}
return;
}
DBG_ERR("fsp->num_aio_requests=%u\n", num_requests); DBG_ERR("fsp->num_aio_requests=%u\n", num_requests);
smb_panic("can not close with outstanding aio requests"); smb_panic("can not close with outstanding aio requests");
return; return;
} }
/**************************************************************************** /****************************************************************************
Close a file. Close a file.
close_type can be NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE. close_type can be NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE.
printing and magic scripts are only run on normal close. printing and magic scripts are only run on normal close.
 End of changes. 2 change blocks. 
0 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)