lib/param: enable "server multi channel support" by default on Linux and FreeBSD
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Jul 2021 22:14:24 +0000 (00:14 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Jul 2021 00:06:31 +0000 (00:06 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/protocol/servermultichannelsupport.xml
lib/param/loadparm.c
source3/param/loadparm.c
source3/smbd/smb2_server.c

index 5f87298b4bd1b48a54ee998c4e15e4594b422811..105627139a52540fa8e3ee56086af43f8eecdcc1 100644 (file)
     </para>
     <para>This parameter was added with version 4.4.</para>
     <para>
-    Warning: Note that this feature is still considered experimental.
-    Use it at your own risk: Even though it may seem to work well in testing,
-    it may result in data corruption under some race conditions.
-    Future releases may improve this situation.
+    Note that this feature was still considered experimental up to 4.14.
     </para>
 
     <para>Due to dependencies to kernel APIs of Linux or FreeBSD, it's only possible
     to use this feature on Linux and FreeBSD for now. For testing this restriction
     can be overwritten by specifying <constant>force:server multi channel support=yes</constant>
     in addition.</para>
+
+    <para>
+    This option is enabled by default starting with to 4.15 (on Linux and FreeBSD).
+    </para>
 </description>
 
-<value type="default">no</value>
+<value type="default">yes</value>
 </samba:parameter>
index 3bb711a5f19da1ab28c768eae2766fdeddc63eac..b3dd77279cc687311ab682f84a208513e2e48c2e 100644 (file)
@@ -2924,6 +2924,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "smb2 leases", "yes");
 
+       lpcfg_do_global_parameter(lp_ctx, "server multi channel support", "yes");
+
        lpcfg_do_global_parameter(lp_ctx, "kerberos encryption types", "all");
 
        lpcfg_do_global_parameter(lp_ctx,
index 23ca2cafbedd54f8776ab1c7689cd2872283f8d6..3b9cd1835fba71aee586d02e8c8ad76923c42736 100644 (file)
@@ -867,6 +867,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
        Globals.smb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
        Globals.smb2_leases = true;
+       Globals.server_multi_channel_support = true;
 
        lpcfg_string_set(Globals.ctx, &Globals.ncalrpc_dir,
                         get_dyn_NCALRPCDIR());
index 2d9f0d2cc74a1972abbb13aa423dd5cf41bc62a3..82aa483055bb01f8e6723a7ef4331a299f149ce6 100644 (file)
@@ -23,6 +23,7 @@
 #include "system/network.h"
 #include "smbd/smbd.h"
 #include "smbd/globals.h"
+#include "lib/param/param.h"
 #include "../libcli/smb/smb_common.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
@@ -1132,6 +1133,11 @@ bool smbXsrv_server_multi_channel_enabled(void)
        bool enabled = lp_server_multi_channel_support();
 #ifndef __ALLOW_MULTI_CHANNEL_SUPPORT
        bool forced = false;
+       struct loadparm_context *lp_ctx = loadparm_init_s3(NULL, loadparm_s3_helpers());
+       bool unspecified = lpcfg_parm_is_unspecified(lp_ctx, "server multi channel support");
+       if (unspecified) {
+               enabled = false;
+       }
        /*
         * If we don't have support from the kernel
         * to ask for the un-acked number of bytes
@@ -1147,6 +1153,7 @@ bool smbXsrv_server_multi_channel_enabled(void)
                        "https://bugzilla.samba.org/show_bug.cgi?id=11897\n"));
                enabled = false;
        }
+       TALLOC_FREE(lp_ctx);
 #endif /* ! __ALLOW_MULTI_CHANNEL_SUPPORT */
        return enabled;
 }