The Samba-Bugzilla – Attachment 13013 Details for
Bug 12608
smbd stops reading SMB2 packets when the output queue grows too large.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.4, 4.5 and 4.6 cherry-picked from master
bug12608-v44,v45,v46.patch (text/plain), 2.31 KB, created by
Ralph Böhme
on 2017-03-03 12:14:25 UTC
(
hide
)
Description:
Patch for 4.4, 4.5 and 4.6 cherry-picked from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2017-03-03 12:14:25 UTC
Size:
2.31 KB
patch
obsolete
>From ad9828770e8c7d13865da219d1a6d532fc1d360b Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 2 Mar 2017 09:13:23 -0800 >Subject: [PATCH] s3: smbd: Restart reading the incoming SMB2 fd when the send > queue is drained. >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When the send queue grows greater than xconn->smb2.credits.max/16, >smbd_smb2_request_next_incoming() doesn't allocate a new request in state->req. > >After smbd_smb2_io_handler() is called, it marks the fd not readable as >state->req == NULL, and never marks it readable again. > >Fix by calling smbd_smb2_request_next_incoming() to restart >reads inside smbd_smb2_flush_send_queue() which drains the >send queue. > >Reported by <chen.yehua@h3c.com> > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12608 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> > >Autobuild-User(master): Ralph Böhme <slow@samba.org> >Autobuild-Date(master): Fri Mar 3 02:23:20 CET 2017 on sn-devel-144 > >(cherry picked from commit 1e0c79ddb34be9a2b9fa92d35387c443c4a381ae) >--- > source3/smbd/smb2_server.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c >index b0a4afc..acaa012 100644 >--- a/source3/smbd/smb2_server.c >+++ b/source3/smbd/smb2_server.c >@@ -3566,6 +3566,7 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn) > int ret; > int err; > bool retry; >+ NTSTATUS status; > > if (xconn->smb2.send_queue == NULL) { > TEVENT_FD_NOT_WRITEABLE(xconn->transport.fde); >@@ -3577,11 +3578,12 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn) > bool ok; > > if (e->sendfile_header != NULL) { >- NTSTATUS status = NT_STATUS_INTERNAL_ERROR; > size_t size = 0; > size_t i = 0; > uint8_t *buf; > >+ status = NT_STATUS_INTERNAL_ERROR; >+ > for (i=0; i < e->count; i++) { > size += e->vector[i].iov_len; > } >@@ -3653,6 +3655,16 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn) > talloc_free(e->mem_ctx); > } > >+ /* >+ * Restart reads if we were blocked on >+ * draining the send queue. >+ */ >+ >+ status = smbd_smb2_request_next_incoming(xconn); >+ if (!NT_STATUS_IS_OK(status)) { >+ return status; >+ } >+ > return NT_STATUS_OK; > } > >-- >2.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
slow
:
review?
(
metze
)
Actions:
View
Attachments on
bug 12608
: 13013