The Samba-Bugzilla – Attachment 6728 Details for
Bug 8335
file copy aborts with smb2_validate_message_id: bad message_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.0
look (text/plain), 3.73 KB, created by
Jeremy Allison
on 2011-07-29 03:29:24 UTC
(
hide
)
Description:
git-am fix for 3.6.0
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-07-29 03:29:24 UTC
Size:
3.73 KB
patch
obsolete
>From 8bd32f489700a31c14e50a914a38f421fe3cfaea Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 28 Jul 2011 20:22:45 -0700 >Subject: [PATCH 1/2] First part of bugfix for bug #8335 - file copy aborts with smb2_validate_message_id: bad message_id > >Set default max credits to 8192 now this has been documented in the >SMB2 spec. >--- > docs-xml/smbdotconf/protocol/smb2maxcredits.xml | 2 +- > source3/include/local.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/docs-xml/smbdotconf/protocol/smb2maxcredits.xml b/docs-xml/smbdotconf/protocol/smb2maxcredits.xml >index 69d04f7..310b898 100644 >--- a/docs-xml/smbdotconf/protocol/smb2maxcredits.xml >+++ b/docs-xml/smbdotconf/protocol/smb2maxcredits.xml >@@ -8,7 +8,7 @@ > that Samba tells the client it will allow. This is similar to the <smbconfoption name="max mux"/> > parameter for SMB1. You should never need to set this parameter. > </para> >-<para>The default is 128 credits, which is the same as a Windows SMB2 server.</para> >+<para>The default is 8192 credits, which is the same as a Windows 2008R2 SMB2 server.</para> > </description> > > <value type="default">128</value> >diff --git a/source3/include/local.h b/source3/include/local.h >index 594f700..d71a72c 100644 >--- a/source3/include/local.h >+++ b/source3/include/local.h >@@ -235,7 +235,7 @@ > #define DEFAULT_SMB2_MAX_READ (1024*1024) > #define DEFAULT_SMB2_MAX_WRITE (1024*1024) > #define DEFAULT_SMB2_MAX_TRANSACT (1024*1024) >-#define DEFAULT_SMB2_MAX_CREDITS 128 >+#define DEFAULT_SMB2_MAX_CREDITS 8192 > #define DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR 2 > > #endif >-- >1.7.1 > > >From 0159b0e3d3b51d468e9494c33c123636e0ad718d Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 28 Jul 2011 20:23:30 -0700 >Subject: [PATCH 2/2] Secod part of bugfix for bug #8335 - file copy aborts with smb2_validate_message_id: bad message_id > >Modify the credit granting algorithm to closer to what I believe >Windows does. > >Split up max_credits into 1/16ths, and then scale >the requested credits by how many 16ths have been >currently granted. Less than 1/16th == grant all >requested (100%), scale down as more have been >granted. Never ask for less than 1 if the client >asked for at least 1. >--- > source3/smbd/smb2_server.c | 27 ++++++++++++++++++++++++--- > 1 files changed, 24 insertions(+), 3 deletions(-) > >diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c >index 65454ae..48fb20f 100644 >--- a/source3/smbd/smb2_server.c >+++ b/source3/smbd/smb2_server.c >@@ -455,9 +455,30 @@ static void smb2_set_operation_credit(struct smbd_server_connection *sconn, > > SMB_ASSERT(sconn->smb2.max_credits >= sconn->smb2.credits_granted); > >- /* Remember what we gave out. */ >- credits_granted = MIN(credits_requested, (sconn->smb2.max_credits - >- sconn->smb2.credits_granted)); >+ if (credits_requested) { >+ uint16_t modified_credits_requested; >+ uint32_t multiplier; >+ >+ /* >+ * Split up max_credits into 1/16ths, and then scale >+ * the requested credits by how many 16ths have been >+ * currently granted. Less than 1/16th == grant all >+ * requested (100%), scale down as more have been >+ * granted. Never ask for less than 1 as the client >+ * asked for at least 1. JRA. >+ */ >+ >+ multiplier = 16 - (((sconn->smb2.credits_granted * 16) / sconn->smb2.max_credits) % 16); >+ >+ modified_credits_requested = (multiplier * credits_requested) / 16; >+ if (modified_credits_requested == 0) { >+ modified_credits_requested = 1; >+ } >+ >+ /* Remember what we gave out. */ >+ credits_granted = MIN(modified_credits_requested, >+ (sconn->smb2.max_credits - sconn->smb2.credits_granted)); >+ } > > if (credits_granted == 0 && sconn->smb2.credits_granted == 0) { > /* First negprot packet, or ensure the client credits can >-- >1.7.1 >
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
Actions:
View
Attachments on
bug 8335
:
6727
|
6728
|
6731