diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
commit | e5a951325a6cac8567af3a66de6d2df577508ae4 (patch) | |
tree | 34da9fe59f3c2d7f8edb072144443a9704197831 /source3/smbd/close.c | |
parent | 57482469b32645250e92a7ffd003aeeb4a42235e (diff) | |
download | samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.gz samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.xz samba-e5a951325a6cac8567af3a66de6d2df577508ae4.zip |
[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
Diffstat (limited to 'source3/smbd/close.c')
-rw-r--r-- | source3/smbd/close.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index aee1c92f7b2..ae45aaa6dac 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -345,16 +345,28 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_ NTSTATUS status = NT_STATUS_OK; NTSTATUS saved_status1 = NT_STATUS_OK; NTSTATUS saved_status2 = NT_STATUS_OK; + NTSTATUS saved_status3 = NT_STATUS_OK; connection_struct *conn = fsp->conn; - cancel_aio_by_fsp(fsp); + if (fsp->aio_write_behind) { + /* + * If we're finishing write behind on a close we can get a write + * error here, we must remember this. + */ + int ret = wait_for_aio_completion(fsp); + if (ret) { + saved_status1 = map_nt_error_from_unix(ret); + } + } else { + cancel_aio_by_fsp(fsp); + } /* * If we're flushing on a close we can get a write * error here, we must remember this. */ - saved_status1 = close_filestruct(fsp); + saved_status2 = close_filestruct(fsp); if (fsp->print_file) { print_fsp_end(fsp, close_type); @@ -368,7 +380,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_ if (fsp->fh->ref_count == 1) { /* Should we return on error here... ? */ - saved_status2 = close_remove_share_mode(fsp, close_type); + saved_status3 = close_remove_share_mode(fsp, close_type); } if(fsp->oplock_type) { @@ -399,6 +411,8 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_ status = saved_status1; } else if (!NT_STATUS_IS_OK(saved_status2)) { status = saved_status2; + } else if (!NT_STATUS_IS_OK(saved_status3)) { + status = saved_status3; } } |