diff options
author | Michael Adam <obnox@samba.org> | 2012-03-03 07:14:35 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-03-03 17:03:06 +0100 |
commit | 87fc8c0f648826b1db0570ba0aa5f03697248569 (patch) | |
tree | be4dd6c8a1410fe610570cd71c20754f1ba010e6 | |
parent | a66d0f33eefde8a28247991aa46ac533a63b7793 (diff) | |
download | samba-87fc8c0f648826b1db0570ba0aa5f03697248569.tar.gz samba-87fc8c0f648826b1db0570ba0aa5f03697248569.tar.bz2 samba-87fc8c0f648826b1db0570ba0aa5f03697248569.zip |
s3:smbd:smb2_write: improve logging in the error case
-rw-r--r-- | source3/smbd/smb2_write.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index 49a77e63a9..b0ffd44b49 100644 --- a/source3/smbd/smb2_write.c +++ b/source3/smbd/smb2_write.c @@ -178,6 +178,20 @@ NTSTATUS smb2_write_complete(struct tevent_req *req, ssize_t nwritten, int err) struct smbd_smb2_write_state); files_struct *fsp = state->fsp; + if (nwritten == -1) { + status = map_nt_error_from_unix(err); + + DEBUG(2, ("smb2_write failed: fnum=[%d/%s] " + "length=%lu offset=%lu nwritten=-1: %s\n", + fsp->fnum, + fsp_str_dbg(fsp), + (unsigned long)state->in_length, + (unsigned long)state->in_offset, + nt_errstr(status))); + + return status; + } + DEBUG(3,("smb2: fnum=[%d/%s] " "length=%lu offset=%lu wrote=%lu\n", fsp->fnum, @@ -186,10 +200,6 @@ NTSTATUS smb2_write_complete(struct tevent_req *req, ssize_t nwritten, int err) (unsigned long)state->in_offset, (unsigned long)nwritten)); - if (nwritten == -1) { - return map_nt_error_from_unix(err); - } - if ((nwritten == 0) && (state->in_length != 0)) { DEBUG(5,("smb2: write [%s] disk full\n", fsp_str_dbg(fsp))); |