From 87fc8c0f648826b1db0570ba0aa5f03697248569 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 3 Mar 2012 07:14:35 +0100 Subject: [PATCH] s3:smbd:smb2_write: improve logging in the error case --- source3/smbd/smb2_write.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index 49a77e63a90..b0ffd44b495 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))); -- 2.11.4.GIT